JSPM

@rubix-code/string-format

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q29942F
  • License MIT

An extensible string formatter for Node.js

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rubix-code/string-format) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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