Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@igorskyflyer/zing

igorskyflyer100MIT2.1.0TypeScript support: included

🐌 Zing is a C# style String formatter for JavaScript that empowers Strings with positional arguments - composite formatting. 🚀

string-format, string-formatting, composite-formatting, positional-arguments, csharp-style-format, string-replace, template-strings, string-utils, typescript, javascript, string-interpolation, format-string, string-helper, string-formatter, string-template, zing, string, formatter, print, c#, c-sharp, utility, igor dimitrijević, igorskyflyer

readme

Icon of Zing

Zing


🐌 Zing is a C# style String formatter for JavaScript that empowers Strings with positional arguments - composite formatting. 🚀



📃 Table of Contents



🤖 Features

  • ⚡ Quick formatting - Drop in {0}, {1} placeholders and swap them instantly
  • 🛠 C#-style syntax - Familiar composite formatting for .NET devs in JS/TS
  • 🎯 Positional arguments - Control exactly where each value lands
  • 🛡 Safe fallback - Leaves unknown placeholders untouched
  • 🧩 Lightweight utility - No dependencies, minimal footprint
  • 🔄 Multi-replace - Handles all matching placeholders in one pass
  • 📜 TypeScript-ready - Strong typing for cleaner code
  • 🌍 Cross-platform - Works in browser and Node environments

ℹ️ NOTE

More information about composite formatting.



🕵🏼 Usage

Install it by executing any of the following, depending on your preferred package manager:

pnpm add @igorskyflyer/zing
yarn add @igorskyflyer/zing
npm i @igorskyflyer/zing


🤹🏼 API

zing(value: string, ...args: any[]): string

Formats the provided string in a C# style format, i.e. adds the ability to use positional arguments, like seen with String.Format in C#.

value: string => The string to process that support positional parameters, i.e. zing('Hello {0} {1}', 'Igor', 'Dimitrijević') would output Hello Igor Dimitrijević.

The returned value is always a string.



📝 Changelog

📑 The changelog is available here, CHANGELOG.md.



🪪 License

Licensed under the MIT license which is available here, MIT license.



💖 Support

I work hard for every project, including this one and your support means a lot to me!
Consider buying me a coffee. ☕

Donate to igorskyflyer

Thank you for supporting my efforts! 🙏😊


@igorskyflyer/recursive-readdir

📖 Provides recursive readdir() and readdirSync() functions. 📁


@igorskyflyer/regkeys

📚 An npm package for fetching Windows registry keys. 🗝


@igorskyflyer/jmap

🕶️ Reads a JSON file into a Map. 🌻


@igorskyflyer/unc-path

🥽 Provides ways of parsing UNC paths and checking whether they are valid. 🎱


@igorskyflyer/scrollend-polyfill

🛴 A performant and light (< 1KB) JavaScript polyfill for the scrollend Event. ⛸️




👨🏻‍💻 Author

Created by Igor Dimitrijević (@igorskyflyer).

changelog

📒 Changelog

of @igorskyflyer/zing


v2.1.0 (30-Aug-2025)

  • 💻 dev: upgrade Node to >= v22
  • 💻 dev: upgrade dependencies


v2.0.1 (11-Jul-2024)

  • 💻 dev: switch to TypeScript and Node v20


v2.0.0 (04-Aug-2023)


  • ✅ fix: improve input handling
  • 💻 dev: move to TypeScript
  • 💻 dev: move to Vitest


1.0.0 (21-Aug-2022)

  • 🚀 launch: initial release 🎉