<commit_before># environment [![Build Status](https://travis-ci.org/atom-community/environment.svg)](https://travis-ci.org/atom-community/environment)

A package for the [Atom Editor](https://atom.io) that provides a normalized environment as a service to other packages. The service can be consumed by placing the following in your `package.json` file:

```json
{
  "name": "your-package-name",
  "main": "./lib/main",
  "<...>": "<other parts of your package.json here>",
  "consumedServices": {
    "environment": {
      "versions": {
        "1.0.0": "consumeEnvironment"
      }
    }
  }
}
```

Then, in your `main.js` file, add the following:

```javascript
consumeEnvironment (environment) {
  this.environment = environment
}
```

The environment is a hash, of the same format as that provided by `process.env`.

## What Does This Package Actually Do?

On platforms other than Mac OS X, the environment that this package provides is identical to `process.env`.

On Mac OS X, a check is made to determine whether `atom` was launched from a terminal, or if it was launched via `Dock`, `Finder`, `Spotlight`, or `open` (i.e. `launchctl` launched processes).

If `atom` was launched by a `launchctl` launched process, the environment available to `atom` is anaemic. This is particularly problematic for packages that depend on a sane environment to function correctly (e.g. anything that launches an external process).

If the environment is not sane, this package will launch the user's shell (as defined in `process.env.SHELL`) and then run `env` from that shell. The resulting environment is captured and then provided to any consumer of this service.

This package will also delete the `DYLD_INSERT_LIBRARIES` environment variable (if set) from the environment on OS X.<commit_msg>Update README To Describe New Behavior<commit_after># environment [![Build Status](https://travis-ci.org/atom-community/environment.svg)](https://travis-ci.org/atom-community/environment)

A package for the [Atom Editor](https://atom.io) that provides a normalized environment as a service to other packages. The service can be consumed by placing the following in your `package.json` file:

```json
{
  "name": "your-package-name",
  "main": "./lib/main",
  "<...>": "<other parts of your package.json here>",
  "consumedServices": {
    "environment": {
      "versions": {
        "1.0.0": "consumeEnvironment"
      }
    }
  }
}
```

Then, in your `main.js` file, add the following:

```javascript
consumeEnvironment (environment) {
  this.environment = environment
}
```

The environment is a hash, of the same format as that provided by `process.env`.

## What Does This Package Actually Do?

On platforms other than Mac OS X, the environment that this package provides is identical to `process.env`.

On Mac OS X, a check is made to determine whether `atom` was launched from a terminal, or if it was launched via `Dock`, `Finder`, `Spotlight`, or `open` (i.e. `launchd` launched processes).

If `atom` was launched by a `launchd` launched process, the environment available to `atom` is anaemic. This is particularly problematic for packages that depend on a sane environment to function correctly (e.g. anything that launches an external process).

If the environment is not sane, this package will launch the user's shell (as defined in `process.env.SHELL`) and then run `env` from that shell. The resulting environment is captured and then provided to any consumer of this service.

This package is a no-op on Atom >= 1.7.0. It uses functionality built into Atom in 1.7.0+ and allows for that to function in prior versions of Atom.
{'fraction_non_alphanumeric': 0.1042927903137039, 'fraction_numerical': 0.003302146395156852, 'mean_word_length': 4.185449358059914, 'pattern_counts': {'":': 14, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5227889', 'n_tokens_mistral': 1012, 'n_tokens_neox': 983, 'n_words': 464}