1.0.2 • Published 6 years ago

javascript-shortcode-parser v1.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

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