Simple Parameter Injector
Simple Parameter Injector is a Javascript module which injects parameters out of array's and object's into strings.
Installation
Run this command:
$ npm install simple-parameter-injector --save
Examples
var paramsInjector = ; // injecting a string into another stringvar str = paramsInjector;// output: replace this placeholder with a real string // injecting a number into a stringvar str = paramsInjector;// output: mambo nr 5 // injecting an array of placeholders into a stringvar str = paramsInjector;// output: replace this placeholder with another real string // injecting an object of named placeholders into a stringvar placeholders = firstString: 'placeholder' secondString: 'real string';var str = paramsInjector;// output: replace this placeholder with another real string // injecting an object of named placeholders into another object with placeholdersvar placeholders = firstString: 'placeholder' secondString: 'real string';var obj = firstKey: 'i need a :firstString' secondKey: 'with a :secondString';var resultObject = paramsInjector;// resultObject: {// firstKey: 'i need a placeholder',// secondKey: 'with a real string'// }
Versioning
Simple Parameter Injector
follows Semantic Versioning 2.0.0
Contributing
- Fork it!
- Create your feature branch (
git checkout -b feature/my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature/my-new-feature
) - Create new Pull Request
Author
Dimitri König (@dimitrikoenig)
License
The Simple Parameter Injector is open-sourced software licensed under the MIT license