Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Use package.json as a config store.
Install with npm:
$ npm i pkg-store --save
var pkg = require('pkg-store')(process.cwd());
All methods allow the optional use of dot-notation for property keys. See the data-store documentation for all available methods.
.set/.get
The .set
method automatically persists values to package.json
:
pkg.set('bin.foo', 'bar');
console.log(pkg.get('bin'));
//=> { foo: 'bar' }
console.log(pkg.get('bin.foo'));
//=> 'bar'
.has
Returns true
if package.json
has the given property:
console.log(pkg.has('name'));
//=> true
console.log(pkg.has('zzzzzzz'));
//=> false
.union
Add and append array values (automatically persists values to package.json
):
pkg.union('keywords', 'foo');
pkg.union('keywords', 'bar');
pkg.union('keywords', 'baz');
console.log(pkg.get('keywords'));
//=> ['foo', 'bar', 'baz']
Most methods also emit an event. See data-store for more details.
pkg.on('union', function(key, value) {
console.log(arguments);
// { '0': 'keywords', '1': 'foo' }
// { '0': 'keywords', '1': 'bar' }
// { '0': 'keywords', '1': 'baz' }
});
pkg.union('keywords', 'foo');
pkg.union('keywords', 'bar');
pkg.union('keywords', 'baz');
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Jon Schlinkert
Copyright © 2016 Jon Schlinkert Released under the MIT license.
This file was generated by verb on January 23, 2016.
FAQs
Use package.json as a config store.
We found that pkg-store 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.