0.1.0 • Published 3 years ago

dict-to-env-pairs-pmb v0.1.0

Weekly downloads
4
License
ISC
Repository
github
Last release
3 years ago

dict-to-env-pairs-pmb

Convert a dictionary object to an array of key=value pairs.

API

This module exports one function:

dictToEnvPairs(dict, opt)

dict is a dictionary object.

opts is an optional options object that supports these optional keys:

  • pfx: Prefix for each line. Default: empty string.
  • sep: Separator for each line. Default: '='.
  • suf: Suffix for each line. Default: empty string.
  • reKey: A function that encodes/quotes/defuses the keys.
  • reVal: A function that encodes/quotes/defuses the values.

Usage

see test/basics.mjs

Known issues

  • Needs more/better tests and docs.

 

License

ISC