Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

recursively-keys

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recursively-keys

Recursively-keys module for obtaining the keys in a Object recursively

latest
Source
npmnpm
Version
2.1.0
Version published
Maintainers
1
Created
Source

Recursively-Keys

=====================================================

A simple library that helps you to get all the keys in an Object even DEEPLY.

Installation

npm install recursively-keys --save

Usage

var getKeys = require('recursively-keys');

var options = {recursive : true};

var object = {
	a: 1,
	b : 2,
	c : [1,23,45],
	d : {
		x : 1,
		a : 2,
		v : [3,2,1,5]
	},
	e : [ 1, 'a', {f : 1}, [ {g : 1} ]]
}

var keys = getKeys(object, options);

// This will result in -- Keys : a,b,c,d,x,a,v,e,f,g

var keys = getKeys(object);

// This will result in -- Keys : a,b,c,d,e

getKeys(object, [options])

object - A JSON object
options - A JSON object which can include
	recursive - (boolean) if true, it will return all the keys deeply. If false, it will only return the first level of keys.
	(Other options will be included in further versions)

Tests

npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality. Lint and test your code.

Release History

* 0.1.0 Initial Release

Keywords

recursive-keys

FAQs

Package last updated on 30 Jul 2016

Did you know?

Socket

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.

Install

Related posts