npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

power-string-number

v1.0.4

Published

強化 String 與 Number prototype 的語法糖

Readme

power-string-number.js

強化 String 與 Number prototype 的語法糖

Please visit my Github

Installation

npm install power-string-number

Strengthen

Number

  • Number.isInt return {Boolean}
  • Number.isFloat return {Boolean}
  • Number.toCurrency return {String}
  • Number.toTimeCount return {String}
  • Number.correction return {Number}

String

  • String.isNumberString return {Boolean}
  • String.correction return {String} if {String}, {Number} if {NumberString}
  • String.toCurrency return {String}
  • String.validateEmail return {Boolean}
  • String.toTimeCount return {String}
  • String.filterSpace return {String}
  • String.currencyToNumber return {Number}
  • String.nl2br return {String}
  • String.jsonToObject return {Object} or null

Useage

let powerStringNumber = require('powert-string-number');
//String
console.log('0100'.correction);                       //output {Number} 100
console.log('200'.correction);                        //output {Number} 200
console.log('200.345'.correction);                    //output {Number} 200.345
console.log('127.0.0.1'.correction);                  //output {String} 127.0.0.1
console.log('127.0.0.1'.isNumberString);              //output {Boolean} false
console.log('105.99'.isNumberString);                 //output {Boolean} true
console.log('234.ads'.isNumberString);                //output {Boolean} false
console.log('[email protected]'.validateEmail);       //output {Boolean} true
console.log('this is a book'.filterSpace);            //output {String} thisisabook
console.log('this\nis\na\nbook'.nl2br);               //output {String} this<br />is<br />a<br />book
console.log('12398745'.toCurrency);                   //output {String} 12,398,745
console.log('12398745'.isNumberString);               //output {Boolean} true
console.log('adfg'.isNumberString);                   //output {Boolean} false
console.log('3340446'.toTimeCount);                   //output {String} 38 天 15 小時 54 分 06 秒
console.log('3,340,446'.currencyToNumber);            //output {Number} 3340446
console.log(JSON.stringify({a:"a", b:"b"}).jsonToObject);            //output {Object} {a:"a", b:"b"}
//Number
console.log(Number(3340446).toTimeCount);             //output {String} 38 天 15 小時 54 分 06 秒
console.log(Number(123898).isInt);                    //output {Boolean} true
console.log(Number(123898.543).isInt);                //output {Boolean} false
console.log(Number(123898).isFloat);                  //output {Boolean} false
console.log(Number(123898.543).isFloat);              //output {Boolean} true
console.log(Number(3340446).toCurrency);              //output {String} 3,340,446
console.log(Number(3340446).correction);              //output {Number} 3340446

or a slightly less nifty way which doesn't extend String.prototype and Number.prototype

var powerStringNumber = require('powert-string-number/safe');

console.log(powerStringNumber.String.correction('0100'));  //output {Number} 100
console.log(powerStringNumber.String.correction('200'));  //output {Number} 200
console.log(powerStringNumber.String.correction('200.345'));  //output {Number} 200.345
console.log(powerStringNumber.String.isNumberString('127.0.0.1'));  //output {Boolean} false
console.log(powerStringNumber.String.validateEmail('[email protected]'));  //output {Boolean} true
console.log(powerStringNumber.Number.isFloat(123898));  //output {Boolean} false