
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Use package.json as a config store.
Install with npm:
$ npm install pkg-store --save
Inherits cache-base, please see the cache-base
documentation for more details.
Pass the cwd
and options to use, or an options object with cwd
or path
. If nothing is passed, the current working directory will be used.
var pkg = require('pkg-store')(cwd, options);
// or
var pkg = require('pkg-store')(options);
// or
var pkg = require('pkg-store')();
Example
var pkg = require('pkg-store')(process.cwd());
Inherits cache-base, please see the cache-base
documentation for more details.
pkg.set(key, value);
Set property key
with the given value
.
Example
// given {"name": "my-project"}
pkg.set('bin.foo', 'bar');
console.log(pkg.data);
//=> {"name": "my-project", "bin": {"foo": "bar"}}
Persist package.json to the file system at pkg.path
.
pkg.save();
pkg.get(key);
Get property key
from package.json.
Example
// given {"name": "my-project"}
pkg.set('bin.foo', 'bar');
console.log(pkg.get('bin'));
//=> {"foo": "bar"}
pkg.has(key);
Returns true
if package.json
has property key
.
Example
// given: {"name": "my-project"}
console.log(pkg.has('name'));
//=> true
console.log(pkg.has('zzzzzzz'));
//=> false
pkg.union(key, val);
Create array key
, or concatenate values to array key
. Also uniquifies the array.
Example
pkg.union('keywords', 'foo');
pkg.union('keywords', ['bar', 'baz']);
console.log(pkg.get('keywords'));
//=> ['foo', 'bar', 'baz']
You might also be interested in these projects:
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v, on March 31, 2016.
FAQs
Use package.json as a config store.
The npm package pkg-store receives a total of 24,133 weekly downloads. As such, pkg-store popularity was classified as popular.
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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.