New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

nested-object

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nested-object

30 LOC leightweight library to write a data structure's nested property via a string like 'my.nested.property'

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Nested object

30 LOC leightweight library to write a data structure's nested property via a string like 'my.nested.property'.

Why?

Which you want but is not possible:

var options.server.socketOptions.keepalive = 120;

Instead you have to do

var options = {};
options.server = {}
options.server.socketOptions = {}
options.server.socketOptions.keepalive = 120;

See http://stackoverflow.com/questions/37183697/create-nested-object-the-short-way/

Installation

npm install nested-object

How to use

Require nested-object:

var nestedobject = require("nested-object");

You can set a nested property on an object:

var options = nested.set("server.socketOptions.keepalive",120);

LICENSE

MIT

Keywords

nested

FAQs

Package last updated on 12 May 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