Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 1.31 KB

README.md

File metadata and controls

47 lines (33 loc) · 1.31 KB

Flat

Build Status Codacy Badge Coverage Status Coverage Status

This library flattens JSON files.

Before:

{
	"key1": {
		"keyA": "valueI"
	},
	"key2": {
		"keyB": "valueII"
	},
	"key3": { "a": { "b": { "c": 2 } } }
}

After:

{
   "key1.keyA": "valueI",
   "key2.keyB": "valueII",
   "key3.a.b.c": 2
}

The library can do the reverse operation as well: unflatten.

Use the library

The documentation page lists how you can add this library as a dependency of your project.

Credit

Based on the work of Jeffrey Blattman. Created to be compatible with NPM flat.