better-strings
This module provides String.format
C#-like function extending String
object.
Install
To install the module
$ npm install better-strings
How to use
There are two ways of using this module.
Using as string-object method
String.format($0 [, $1, ..., $N])
Only takes strings and numbers as arguments.
//Requiring the module enables the tweak; var result = 'Hello {0}!'; console;//produces 'Hello world!' output
Using as module method
betterString.format(baseString, $0 [, $1, ..., $N])
Only takes strings as firts argument, strings and numbers for the rest of them.
//Requiring the module enables the string method anywayvar betterString = ; var result = betterString; console;//produces 'Hello world!' output
Test
If you want to run the test, get the repository and run
$ npm install$ npm test
Why yet another 'string module'?
I have created this module as an exercise to learn about javascript, node, npm, gulp, unit test, and other dev-things involved in current development proccesses.