javascript-shortcode-parser
v1.0.2
Published
javascript shortcode parser
Downloads
5
Maintainers
Readme
javascript-shortcode-parser
Create a text dynamically using a function to convert "{{short_code}}" to texts.
Description
This function is like a sprintf of php. You'll need to pass a object like {name: 'Foobar' } and a text with shortcodes to be replaced with you short codes.
Install
- npm install javascript-shortcode-parser
- import shortCodeParser from 'javascript-shortcode-parser';
Example 1
Input -> shortCodeParser('My name is {{user_name}}, { user_name: 'foobar' }); Output -> My name is foobar