JSPM

env-string

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 265620
  • Score
    100M100P100Q157465F
  • License MIT

Inlines env vars in a string that contains $NAME expressions

Package Exports

  • env-string

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (env-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

env-string

Inlines env vars in a string that contains $NAME expressions

npm install env-string

Build Status

Usage

var env = require('env-string')
var map = {WORLD: 'world'}

// supports $NAME
console.log(env('hello $WORLD', map)) // 'hello world'

// supports ${NAME}
console.log(env('hello ${WORLD}', map)) // 'hello world'

// supports $NAME-something-else
console.log(env('hello $WORLD-world', map)) // 'hello world-world'

// supports ${NAME:-default-value}
console.log(env('hello ${VERDEN:-world}', map)) // 'hello world'

// vars default to ''
console.log(env('hello $VERDEN', map)) // 'hello '

License

MIT