1.0.3 • Published 6 years ago

ts-transform-node-env-inline v1.0.3

Weekly downloads
117
License
MIT
Repository
github
Last release
6 years ago

ts-transform-node-env-inline

  • :flashlight: Inline environment variables, e.g. process.env.NODE_ENV

Inline environment variables.

Example

In

process.env.NODE_ENV === "development";
process.env.NODE_ENV === "production";
// tsconfig.json
{
  "compilerOptions": {
    "target": "es2015",
    "plugins": [
      {
        "transform": "../lib",
        "type": "config",
        "env": { "NODE_ENV": "hello-world" }
      }
    ]
  }
}

Out

process.env.NODE_ENV === "development";
process.env.NODE_ENV === "production";

Installation

npm install ts-transform-node-env-inline ttypescript --save-dev

Usage

// tsconfig.json
{
  "compilerOptions": {
    "target": "es2015",
    "plugins": [
      {
        "transform": "../lib",
        "type": "config",
        "env": { "NODE_ENV": "production" }
      }
    ]
  }
}

See TTypeScript for docs about integration with other toolchains.


See ./example for a basic setup based on TTypeScript

Prior art

License

MIT

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago