Skip to main content

StdFormat - A Powerful String Formatter

StdFormat is a TypeScript/JavaScript library for powerful string formatting using notation.

Resources

NPM Package | GitHub Repository

API Reference

API Reference

Contains documentaton in the README file.

Quick Start

Install

npm install std-format

Import

import { format, int, float, setLocale, FormatError } from "std-format";

Require

const { format, int, float, setLocale, FormatError } = require("std-format");

Browser Script

<!-- either unpkg -->
<script src="https://unpkg.com/std-format@4.1.1/dist/index.global.js"></script>

<!-- or jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/std-format@4.1.1/dist/index.global.js"></script>

<script>
const { format, int, float, setLocale, FormatError } = window.StdFormat;
</script>

Usage

const result = format("{:d}", 5);

Demo Snippets




License

This project is licensed under the MIT License.

You are free to use, modify, and distribute this software under the terms of the MIT License.

The full license text is available in the project repository.

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.