</>PackageGraphPackageGraph

strnum

npmv2.4.2

Parse String to Number based on configuration

Safe to adopt

Yes — strnum scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 26 days ago. 20 releases in the last 2 years.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • AMaintenance: grade A, Excellent.

    Last published 26 days ago. 20 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Pulls in 1 transitive package, about 30 KB installed.

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding strnum to a project.

1
Direct dependencies

Runtime packages this one declares itself.

1
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

30 KB
Install size

Unpacked size of this package plus its entire runtime tree.

1
Tree depth

Longest resolved dependency chain below this package.

Licenses in the dependency tree

MIT

Every license you inherit by installing strnum, not just its own. Check this before a legal review, not after.

Compatibility

Node.js
No constraint declared
Module format
ESM only
TypeScript
No bundled types
Install scripts
None

Quick start

A usage example from the strnum README.

const toNumber = require("strnum");

toNumber(undefined) // undefined
toNumber(null)) //null
toNumber("")) // ""
toNumber("string"); //"string")
toNumber("12,12"); //"12,12")
toNumber("12 12"); //"12 12")
toNumber("12-12"); //"12-12")
toNumber("12.12.12"); //"12.12.12")
toNumber("0x2f"); //47)
toNumber("-0x2f"); //-47)
toNumber("0x2f", { hex :  true}); //47)
toNumber("-0x2f", { hex :  true}); //-47)
Example truncated — see the full README.

strnum vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
strnumthis page01MIT26 days ago
camelcase95.7M2MIT15 hours ago
get-east-asian-width69.3M1MIT19 hours ago
decamelize62.6M4MIT15 hours ago
css.escape48.7M2MIT17 hours ago
pg-connection-string38.9M2MIT18 hours ago

Dependencies

Declared by strnum v2.4.2. Runtime dependencies are installed with the package; dev dependencies are not.

Runtime (1)

Dev (2)

@byspec/numbers ^0.1.1jasmine ^5.6.0

Used by

Popular packages that depend on strnum.

Relationship graph

Dependencies (left) and dependents (right) of strnum.

anynumfast-xml-parserstrnum
strnum dependencies dependents

Frequently installed together

Release history

20 releases in the last two years, typically about 9 days apart.

Recent versions of strnum
VersionPublishedSizeLicense
2.4.2latest26 days ago14 KBMIT
2.4.12 months ago14 KBMIT
2.4.03 months ago14 KBMIT
2.3.04 months ago13 KBMIT
2.2.35 months ago13 KBMIT
2.2.25 months ago25 KBMIT
2.2.15 months ago25 KBMIT
2.2.06 months ago25 KBMIT
2.1.29 months ago23 KBMIT
2.1.11 year ago23 KBMIT
2.1.01 year ago22 KBMIT
2.0.51 year ago19 KBMIT
1.1.21 year ago19 KBMIT
1.1.11 year ago19 KBMIT
2.0.41 year ago19 KBMIT

Overview

strnum is an npm package that parse String to Number based on configuration. It has 1 known dependents in the graph. The latest version is 2.4.2, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need parse String to Number based on configuration and value a focused solution.

When not to use it

Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.

Pros

  • Clear open-source license (MIT).
  • Lean dependency tree (3 direct dependencies).

Cons

  • No bundled TypeScript types (may require a separate @types package).

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Funding

Frequently asked questions

Should I use strnum?

Yes — strnum scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 26 days ago. 20 releases in the last 2 years.

How do I install strnum?

Run `npm install strnum` to add strnum to your npm project.

How many dependencies does strnum have?

strnum declares 3 direct dependencies and pulls in 1 packages in total once its runtime tree is resolved totalling about 30 KB on disk.

What license is strnum released under?

strnum is distributed under the MIT license.

How popular is strnum?

npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on strnum.

Is strnum still maintained?

The most recent release of strnum (v2.4.2) was published 26 days ago.

Does strnum run install scripts?

No. strnum does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.