
Security News
Federal Government Rescinds Software Supply Chain Mandates, Makes SBOMs Optional
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.
stringify-keys
Advanced tools
Build an array of key paths from an object.
Please consider following this project's author, Brian Woodward, and consider starring the project to show your :heart: and support.
Install with npm:
$ npm install --save stringify-keys
var stringify = require('stringify-keys');
var obj = { a: 'a', b: { c: { d: { e: 'f' } } } };
console.log(stringify(obj));
//=> [ 'a', 'b.c.d.e', 'b.c.d', 'b.c', 'b' ]
Keys with dots are automatically escaped with backslashes (this can be customized):
var obj = { 'a.b.c': { d: 'e' } };
console.log(stringify(obj));
//=> [ 'a\\.b\\.c.d', 'a\\.b\\.c' ]
Type: string
Default: .
Custom separator to use for creating object paths (a.b.c):
Example
var obj = { 'a.b.c': { d: 'e' } };
console.log(stringify(obj, { separator: '/' }));
//=> [ 'a.b.c/d', 'a.b.c' ]
Type: function
Default: adds \\ before dots
Custom function to use for escaping keys.
Example
var obj = { 'a.b.c': { d: 'e' } };
var result = stringify(obj, {
escape: str => str.split('.').join('/')
});
console.log(result);
//=> [ 'a/b/c.d', 'a/b/c' ]
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
| Commits | Contributor |
|---|---|
| 12 | doowb |
| 10 | jonschlinkert |
Brian Woodward
Copyright © 2018, Brian Woodward. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on January 16, 2018.
FAQs
Build an array of key paths from an object.
The npm package stringify-keys receives a total of 5,205 weekly downloads. As such, stringify-keys popularity was classified as popular.
We found that stringify-keys demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.

Security News
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.

Research
/Security News
A Chrome extension claiming to hide Amazon ads was found secretly hijacking affiliate links, replacing creators’ tags with its own without user consent.