An open API service indexing awesome lists of open source software.

https://github.com/wellitongervickas/javascript-shortcode-parser

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.
https://github.com/wellitongervickas/javascript-shortcode-parser

ecmascript helper javascript php sprintf

Last synced: 6 months ago
JSON representation

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.

Awesome Lists containing this project

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

[Npm](https://www.npmjs.com/package/javascript-shortcode-parser)