@rubix-code/string-format

0.1.2 • Public • Published

String-Format

semantic-release: eslint codecov npm version License: MIT

A Highly functional and extensible string formatting library for JS.

Inspiration

This repo is inspired by the following libraries:

All of this libraries are great in their own way. But installing them individually can be tedious. Also, they are not extensible, and have not been maintained for quite some time.

This library aims to provide a single library that can be used to format strings in a variety of ways. It also aims to be extensible, so that you can add your own custom formatters.

Installation

npm install @rubix-code/string-format

Usage

Basic Usage

// Globally apply the default formatters
import "@rubix-code/string-format/register";

// Python style formatting
"My name is {name}".format({ name: "Slim Shady" }); // My name is Slim Shady

// C++ style formatting
"The answer to life, the universe and everything is %d".format(42); // The answer to life, the universe and everything is 42

TODO:

  • [ ] Fix CI/CD pipeline
  • [ ] Add complete documentation

/@rubix-code/string-format/

    Package Sidebar

    Install

    npm i @rubix-code/string-format

    Weekly Downloads

    1

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    2.14 MB

    Total Files

    88

    Last publish

    Collaborators

    • rubix-code