Need private packages and team management tools?Check out npm Teams »

jsoncopy

1.0.0 • Public • Published

jsoncopy

Create a deep clone of an object using JSON functionalities. Very efficient and quick, not a comprehensive copyier (can't copy functions, circular references)

const jsoncopy = require('jsoncopy');
 
const orig = {top: {nested: {value: 1}}};
const copy = jsoncopy(obj);
obj.top.nested.value = 2;
 
orig.top.nested.value // 2
copy.top.nested.value // 1

Keywords

none

Install

npm i jsoncopy

DownloadsWeekly Downloads

825

Version

1.0.0

License

MIT

Unpacked Size

1.38 kB

Total Files

3

Last publish

Collaborators

  • avatar