at-variables
Extract at-variables from strings:
const atVars = const str = ` @name John @age 20 @skills.frontend html @skills.frontend css @skills.backend php @skills.backend java` const vars = console // {// name: 'John',// age: 20,// skills: {// frontend: ['html', 'css'],// backend: ['php', 'java']// }// }
installation
npm install at-variables --save
requirements
Node >= 6
tests
npm install && npm test
usage
atVariables(String) -> Object
Extracts the variables from the string.
atVariables.clear(String) -> String
Removes the variables from the string:
let str = `@key valuemy string` str = atVariablesclearstr console// "my string"
license
MIT