simple.string.format

1.1.2 • Public • Published

simple.string.format

Simple String.format() in javascript.

Lightweight, Zero-dependency

NPM npm version npm bundle size GitHub issues Build Status

Getting Started

Installation

NPM

 npm i simple.string.format 

Usage

    import "simple.string.format";
 
    let helloWorld = "Hello, {0}!".format("World");
    ///Hello, World!
    let example1 = "Hello, {0}! this is example # {1}.".format("World", 1);
    /// Hello, World! this is example # 1.
    let example2 = "{0} + {0} = {1}".format(1, 2);
    /// 1 + 1 = 2
    let example3 = "{{0}} will be replaced with {0}".format("hi");
    /// {0} will be replaced with hi
 

Demo

Demo 1 (RunKit)

Demo 2 (codesandbox)

Demo 3 (stackblitz)

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Mike Shaker
Mike Shaker

🚇 ⚠️ 💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Package Sidebar

Install

npm i simple.string.format

Weekly Downloads

3

Version

1.1.2

License

MIT

Unpacked Size

4.51 kB

Total Files

6

Last publish

Collaborators

  • mshaker