@nanomatic/string_to_object
v2.1.0
Published
Library that allows to create an object from a given string
Downloads
2
Maintainers
Readme
📝 Table of Contents
🏁 Getting Started
Installing
npm i @nanomatic/string_to_object
Using
Example code below:
import { StringToObject } from '@nanomatic/string_to_object';
const factory = {
vehicle: {
1: {
type: '🚑'
},
2: {
type: '🚒'
}
}
};
const obj = new StringToObject(factory, '|');
console.log(factory); // The same as obj.obj object
obj.set(`vehicle|.|type`, '🚓');
console.log(obj.obj); // The same as factory object
const vehicle1 = obj.get(`vehicle|1|type`);
console.log(`Type of vehicle 1 is: ${vehicle1}`);
⛏️ Built With
- ts-node-dev - TypeScript Node Dev
- tsc-watch - The nodemon for TypeScript
- TSLint - TypeScript linter
- NodeJs - Test Environment
✍️ Authors
- @NANOmatic - Idea & Initial work
🎉 Acknowledgments
- Special thanks for Sebastian for working together and giving ideas 😉