has-tostringtag
npmv1.0.2TypeScriptDetermine if the JS environment has `Symbol.toStringTag` support. Supports spec, or shams.
Adopt with care
has-tostringtag is usable, with caveats. Last published 951 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- DMaintenance: grade D, Poor — a real concern.
Last published 951 days ago.
- AWeight: grade A, Excellent.
Pulls in 1 transitive package, about 17 KB installed (at least — some of the tree is still being crawled).
- 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 has-tostringtag 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.
Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.
Compatibility
- Node.js
- node >= 0.4
- Module format
- CommonJS only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the has-tostringtag README.
var hasSymbolToStringTag = require('has-tostringtag');
hasSymbolToStringTag() === true; // if the environment has native Symbol.toStringTag support. Not polyfillable, not forgeable.
var hasSymbolToStringTagKinda = require('has-tostringtag/shams');
hasSymbolToStringTagKinda() === true; // if the environment has a Symbol.toStringTag sham that mostly follows the spec.has-tostringtag 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 |
|---|---|---|---|---|
| has-tostringtagthis page | 0 | 5 | MIT | 2 years ago |
| eslint | 138.4M | 279 | MIT | 1 day ago |
| es-define-property | 131.3M | 4 | MIT | 1 day ago |
| call-bind | 80.7M | 5 | MIT | 1 day ago |
| esprima | 77.6M | 5 | BSD-2-Clause | 1 day ago |
| get-intrinsic | 0 | 8 | MIT | 1 day ago |
Dependencies
Declared by has-tostringtag v1.0.2. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (1)
Dev (14)
Used by
Popular packages that depend on has-tostringtag.
Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag
Is this an arguments object? It's a harder question than you think.
A helper to optimistically set Symbol.toStringTag, when possible.
string representations of objects in node and the browser
Is this value an ES BigInt?
Relationship graph
Dependencies (left) and dependents (right) of has-tostringtag.
Frequently installed together
An AST-based pattern checker for JavaScript.
Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.
A robust, ES3 compatible, "has own property" predicate.
Modern Buffer API polyfill without footguns
string representations of objects in node and the browser
Get and robustly cache all JS language-level intrinsics at first require time
`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
Does this JS environment support the `name` property on functions?
The semantic version parser used by npm.
the most correct and second fastest glob implementation in JavaScript
A simple cache for a few of the JS Error constructors.
Release history
No releases in the last two years, typically about 910 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.0.2latest | 2 years ago | 17 KB | MIT |
| 1.0.1 | 2 years ago | 17 KB | MIT |
| 1.0.0 | 5 years ago | 11 KB | MIT |
Overview
has-tostringtag is an npm package that determine if the JS environment has `Symbol.toStringTag` support. Supports spec, or shams. It has 5 known dependents in the graph. The latest version is 1.0.2, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need determine if the JS environment has `Symbol.toStringTag` support. Supports spec, or shams and value a focused solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use has-tostringtag?
has-tostringtag is usable, with caveats. Last published 951 days ago.
How do I install has-tostringtag?
Run `npm install has-tostringtag` to add has-tostringtag to your npm project.
How many dependencies does has-tostringtag have?
has-tostringtag declares 15 direct dependencies and pulls in 1 packages in total once its runtime tree is resolved totalling about 17 KB on disk.
What license is has-tostringtag released under?
has-tostringtag is distributed under the MIT license.
How popular is has-tostringtag?
npm does not publish download counts. Within PackageGraph's crawl, 5 known packages depend on has-tostringtag.
Is has-tostringtag still maintained?
The most recent release of has-tostringtag (v1.0.2) was published 2 years ago.
Does has-tostringtag run install scripts?
No. has-tostringtag does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.