strnum
npmv2.4.2Parse 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.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Licenses in the dependency tree
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)strnum vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| strnumthis page | 0 | 1 | MIT | 26 days ago |
| camelcase | 95.7M | 2 | MIT | 15 hours ago |
| get-east-asian-width | 69.3M | 1 | MIT | 19 hours ago |
| decamelize | 62.6M | 4 | MIT | 15 hours ago |
| css.escape | 48.7M | 2 | MIT | 17 hours ago |
| pg-connection-string | 38.9M | 2 | MIT | 18 hours ago |
Dependencies
Declared by strnum v2.4.2. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (1)
Dev (2)
Used by
Popular packages that depend on strnum.
Relationship graph
Dependencies (left) and dependents (right) of strnum.
Frequently installed together
An AST-based pattern checker for JavaScript.
Prettier is an opinionated code formatter
Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
Entity parser for XML, HTML, External entites with security and NCR control
Build XML from JSON without C/C++ based libraries
Zero-dependency, DOM-free, pure predicate for detecting unsafe strings across HTML, XML, SVG, SQL, SHELL, and REGEX contexts
Validates XML name productions — Name, NCName, QName, NMToken, NMTokens — for XML 1.0 and 1.1
TypeScript definitions for node
Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals
Release history
20 releases in the last two years, typically about 9 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 2.4.2latest | 26 days ago | 14 KB | MIT |
| 2.4.1 | 2 months ago | 14 KB | MIT |
| 2.4.0 | 3 months ago | 14 KB | MIT |
| 2.3.0 | 4 months ago | 13 KB | MIT |
| 2.2.3 | 5 months ago | 13 KB | MIT |
| 2.2.2 | 5 months ago | 25 KB | MIT |
| 2.2.1 | 5 months ago | 25 KB | MIT |
| 2.2.0 | 6 months ago | 25 KB | MIT |
| 2.1.2 | 9 months ago | 23 KB | MIT |
| 2.1.1 | 1 year ago | 23 KB | MIT |
| 2.1.0 | 1 year ago | 22 KB | MIT |
| 2.0.5 | 1 year ago | 19 KB | MIT |
| 1.1.2 | 1 year ago | 19 KB | MIT |
| 1.1.1 | 1 year ago | 19 KB | MIT |
| 2.0.4 | 1 year ago | 19 KB | MIT |
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
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.