Skip to content

Only the sprintf and vsprintf functions of loctus.js

License

Notifications You must be signed in to change notification settings

code-lts/locutus.sprintf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Locutus.sprintf

npm version

Find our package on NPM at: https://www.npmjs.com/package/locutus.sprintf

Locutus's version of sprintf and vsprintf in an NPM package

More info at: https://locutus.io/php/strings/sprintf/

This project is a fork of https://github.com/locutusjs/locutus and @code-lts will do it's best to keep this up to date.

Install

You can use the locutus package is you only want the Node version

npm install locutus.sprintf

or

yarn add locutus.sprintf

Use for Node

var sprintf = require('locutus/php/strings/sprintf')
var effectiveness = 'futile'
console.log(sprintf('Resistance is %s', effectiveness))

Use for a browser

<script type="text/javascript" src="vendor/js/locutus.sprintf/sprintf.js"></script>
var effectiveness = 'futile'
console.log(sprintf('Resistance is %s', effectiveness))

Package tree

.
├── LICENSE
├── package.json
├── README.md
└── src
    └── php
        ├── index.js
        └── strings
            ├── sprintf.browser.js
            ├── sprintf.js
            ├── vsprintf.browser.js
            └── vsprintf.js

3 directories, 8 files