Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Message Interpolation

The process of formatting messages for internationalization.

Install

$ npm i message-interpolation
# or
$ yarn add message-interpolation
# or
$ pnpm i message-interpolation
# or
$ bun add message-interpolation

Usage

import mi from 'message-interpolation';

/**
 * Named interpolation
 */
const msg = `{say}, World!`;
mi(msg, { say: 'Hello' });
// Hello, World!

/**
 * List interpolation
 */
const alphabet = `{0} B {1} D {2} F G`;
mi(alphabet, ['A', 'C', 'E']);
// A B C D E F G

About

The process of formatting messages for internationalization.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages