Skip to content

Commit

Permalink
Add deprecation util for the sprintf and vsprintf functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorik Tangelder committed Jan 19, 2016
1 parent 7c03e83 commit f333164
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 2 additions & 4 deletions README.markdown
Expand Up @@ -530,11 +530,9 @@ words(" ")

#### sprintf(string format, ...arguments) => string

C like string formatting.
Credits goes to [Alexandru Marasteanu][o].
For more detailed documentation, see the [original page][o].
C like string formatting. Makes use of the [sprintf-js](https://npmjs.org/package/sprintf-js) package.

[o]: http://www.diveintojavascript.com/projects/javascript-sprintf
**This function will be removed in the next major release, use the [sprintf-js](https://npmjs.org/package/sprintf-js) package instead.**

```javascript
sprintf("%.1f", 1.17);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -61,6 +61,7 @@
}
},
"dependencies": {
"sprintf-js": "^1.0.3"
"sprintf-js": "^1.0.3",
"util-deprecate": "^1.0.2"
}
}
5 changes: 4 additions & 1 deletion sprintf.js
@@ -1 +1,4 @@
module.exports = require('sprintf-js').sprintf;
var deprecate = require('util-deprecate');

module.exports = deprecate(require('sprintf-js').sprintf,
'sprintf() will be removed the next major release, use the sprintf-js package instead.');
5 changes: 4 additions & 1 deletion vsprintf.js
@@ -1 +1,4 @@
module.exports = require('sprintf-js').vsprintf;
var deprecate = require('util-deprecate');

module.exports = deprecate(require('sprintf-js').vsprintf,
'vsprintf() will be removed the next major release, use the sprintf-js package instead.');

0 comments on commit f333164

Please sign in to comment.