
Company News
Socket Has Acquired Secure Annex
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.
dirp - a key-value in-memory store using tokenized path as a key.
unset() can remove all values under the same path (performance)undefined (safety)$ npm install dirp --save
var capitals = require('dirp').create();
capitals.set('us.alabama', 'montgomery');
capitals.set('us.california', 'sacramento');
capitals.set('jp.tokyo', 'shinjuku');
capitals.set('jp.osaka', 'osaka');
console.log(capitals.get('us.alabama'));
// montgomery
console.log(capitals.get('us.california'));
// sacramento
console.log(capitals.raw());
// { us: { alabama: 'montgomery', california: 'sacramento' },
// jp: { tokyo: 'shinjuku', osaka: 'osaka' } }
console.log(capitals.get('us.tokyo')); // incorrect
// undefined
capitals.unset('us'); // clear all data at paths that start with 'us'
console.log(capitals.raw());
// { jp: { tokyo: 'shinjuku', osaka: 'osaka' } }
create() => instance {Dirp}
create(delimiter) => instance {Dirp}
create(delimiter, data) => instance {Dirp}
create(data) => instance {Dirp}
delimiter {string} Path delimiter. Defaults to '.'
data {object} Data to be imported.
data, see import section below.set(path, value) => {boolean}
path {string} Path to a value
value {any} Arbitrary value
returns true on success
get(path) => {any}
path {string} Path to a value
undefined is returned if the path is not a leaf.unset(path) => {boolean}
path {string} Path to be unset
returns true on success
exists(path) => {boolean}
path {string} Path to be tested
raw() => {object}
clone() => {Dirp}
set() contains a getter/setter, or properties that are not enumerable, those would be ignored. (Note: this may change in the future)import(data) => {void}
data {object} Object to be imported. e.g { 'user.name': 'foo', 'user.age': 27 } // a list of `path`:`value` pairs.
export() => {object}
data {object} Exported object with a list of `path`:`value` pairs.
FAQs
A key-value in-memory store using tokenized path as a key.
The npm package dirp receives a total of 321 weekly downloads. As such, dirp popularity was classified as not popular.
We found that dirp 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.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.