
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
uenv is a zero dependency configuration manager for nodejs, its design goals is to be very fast, allow finely grained access to properties via references, have an easy and straight-forward plugin system, allow different routines within the system to set up different parts of the configuration without having to be aware of the entire tree structure
npm install --save uenv
const path = require('path')
const uenv = require('uenv')
// import enviorment variables into configuration
uenv.env()
// assign an object to the root of the configuraiton tree
uenv.assign({
foo: 'bar',
nested: {
object: {
a: 1
}
}
})
uenv.set('nested.object.b', 2)
// creates a new child with the literal plugin
const child = uenv.literalChild('childProperty')
// sets a value referenced as 'child.childfoo'
child.set('childfoo', 'childbar')
// assign multiple values to child
child.assign({
c: 9,
d: 10
})
// assign json contents to configuraiton root
// assuming json1.json contents is { "jsonProperty": { "jsonA": 1, "jsonB": 2 } }
uenv.json(path.join(__dirname, 'assets', 'json1.json'))
// assign json contents to { jsonData: {} }
uenv.jsonChild('jsonData', path.join(__dirname, 'assets', 'json1.json'))
// seal a property against changes
uenv.seal('foo')
uenv.set('foo', 'notbar')
uenv.get('foo') // bar
uenv.equals('foo', 'bar') // true
uenv.get('nested') // { object: { a: 1, b: 2 } }
uenv.get('nested.object') // { a: 1, b: 2 }
uenv.get('nested.object.a') // 1
uenv.get('childProperty') // { childfoo: 'childbar', c: 9, d: 10 })
uenv.get('jsonProperty') // { jsonA: 1, jsonB: 2 }
uenv.get('jsonData.jsonProperty') // { jsonA: 1, jsonB: 2 })
uenv.pick('nested.object', ['b']) // { b: 2 }
uenv.omit('nested.object', ['b']) // { a: 2 }
uenv.any(['nested.object.c', 'nested.object.b', 'nested.object.c']) // 2
// get entire configuration as plain javascript object
uenv.toJSON()
const uenv = require('uenv')
function MyPlugin (methods, arg1) {
// methods are { set, get, has, assign, toJSON }
// and would behave depending on the plugin mounted position
this.__methods = methods
this.__arg1 = arg1
}
MyPlugin.prototype.set = function (k, v) {
this.__methods.set(k, `${this.__arg1}-${v}`)
}
uenv.plugin('useless', MyPlugin)
const useless = uenv.useless('addthis')
useless.set('foo', 'bar')
uenv.get('foo') // addthis-bar
uenv-s3-plugin)[https://github.com/oiime/uenv-s3-plugin] - stores and retrieves configuration from AWS S3, allows encryption before storageAssigns an entire object to the configuration
Assigns an entire object to the configuration
Returns a property value
Checks if key exists, returns a boolean
Returns a plain javascript object of all properties
registers a new plugin, Plugin would be constructed whenever use or child are called with its name
Initiates a plugin that'll have access to the properties, any arguments after the plugin name would be passed as arguments to the plugin itself
this is accessible via the shorthand method uenv.[plugin name] eg uenv.json()
Initiates a plugin that'll have access to the properties at a specific position, any arguments after the plugin name would be passed as arguments to the plugin itself
Key can be dot notated to get a child at a deeper part of the tree, any preceding keys would be created with references, this is accessible via the shorthand method [plugin name]Child
Checks if a key is equal to a value, returns a boolean
Seals a key, any subsequent attempts to write to this key would not change the stored value
returns the first trueish key in the array
if key is a plain javascript object, only the properties listed would be returned in a new object
if key is a plain javascript object, only the properties not listed would be returned in a new object
Allows changes internal options within uenv
uenv.setOptions({ separator: ':'})
uenv.set('foo:bar', 1)
uenv.get('foo:bar')
Gets a standalone instance of uenv that does not store its properties at the module itself
saves current configuration to json file, if filename is not provided it'll save to the same filename set up during construction
License: MIT
FAQs
hierarchical configuration manager with zero dependencies
The npm package uenv receives a total of 16 weekly downloads. As such, uenv popularity was classified as not popular.
We found that uenv demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.