npm install https://github.com/Kaelinator/hopps
Since 1.0.0 has yet to be released to npm, this package must be downloaded directly from the repository.
- Robust
- Highly versatile
- As strict as you'd like
- Built Functionally
- Zero dependencies
Basics
const hopps = require('hopps')
hopps.set('a.b.c', { d: 1 }, 'hi!')
/* => {
a: {
b: {
c: 'hi!'
}
},
d: 1
}*/
- Invocable Methods
.get(template, data)
- get deeply burrowed data.set(template, data, value)
- set deeply burrowed data.put(template, data, value)
- like.set
, but values are not overwritten
- Chainable Methods
.thump
- throw errors instead of curbing them
Chainable methods make your code easy to read, while maintaining brevity.
Invocable methods, while limited, provide a condence syntax for quick, intuitive data manipulation. It is recommended to use chainable methods for more complex manipulation.