javascript-shortcode-parser

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i javascript-shortcode-parser

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

1.57 kB

Total Files

3

Last publish

Collaborators

  • wellitogervickas