hasown
npmv2.0.4TypeScriptA robust, ES3 compatible, "has own property" predicate.
Safe to adopt
Yes — hasown scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 104 days ago. 2 releases in the last 2 years.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- BMaintenance: grade B, Good.
Last published 104 days ago. 2 releases in the last 2 years.
- AWeight: grade A, Excellent.
Pulls in 1 transitive package, about 41 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 2 maintainers, and a contained dependency surface.
- 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 hasown 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 hasown, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >= 0.4
- Module format
- CommonJS only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the hasown README.
const assert = require('assert');
const hasOwn = require('hasown');
assert.equal(hasOwn({}, 'toString'), false);
assert.equal(hasOwn([], 'length'), true);
assert.equal(hasOwn({ a: 42 }, 'a'), true);hasown 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 |
|---|---|---|---|---|
| hasownthis page | 0 | 8 | MIT | 3 months ago |
| es-define-property | 131.3M | 4 | MIT | 1 day ago |
| define-data-property | 0 | 2 | MIT | 1 day ago |
| gopd | 0 | 7 | MIT | 1 day ago |
| eslint | 138.4M | 279 | MIT | 1 day ago |
| call-bind | 80.7M | 5 | MIT | 1 day ago |
Dependencies
Declared by hasown v2.0.4. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (1)
Dev (16)
Used by
Popular packages that depend on hasown.
ES spec-like internal slots
Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag
Get and robustly cache all JS language-level intrinsics at first require time
ES6 spec-compliant RegExp.prototype.flags shim.
A library to create readable "multipart/form-data" streams. Can be used to submit forms and file uploads to other web applications.
Is this specifier a node.js core module?
Define a data property on an object. Will fall back to assignment in an engine without descriptors.
A helper to optimistically set Symbol.toStringTag, when possible.
Relationship graph
Dependencies (left) and dependents (right) of hasown.
Frequently installed together
An AST-based pattern checker for JavaScript.
A simple cache for a few of the JS Error constructors.
`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
string representations of objects in node and the browser
`Object.defineProperty`, but not IE 8's broken one.
Determine if the JS environment has `Symbol.toStringTag` support. Supports spec, or shams.
The semantic version parser used by npm.
Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.
The ultimate javascript content-type utility.
ES Math-related intrinsics and helpers, robustly cached.
Robustly `.call.bind()` a function
Simplified HTTP request client.
Release history
2 releases in the last two years, typically about 113 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 2.0.4latest | 3 months ago | 10 KB | MIT |
| 2.0.3 | 4 months ago | 9.8 KB | MIT |
| 2.0.2 | 2 years ago | 8.6 KB | MIT |
| 2.0.1 | 2 years ago | 11 KB | MIT |
| 2.0.0 | 2 years ago | 11 KB | MIT |
| 1.0.1 | 12 years ago | — | MIT |
Overview
hasown is an npm package that a robust, ES3 compatible, "has own property" predicate. It has 8 known dependents in the graph. The latest version is 2.0.4, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need a robust, ES3 compatible, "has own property" predicate and value a focused solution.
When not to use it
Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- Large dependency tree (17 direct dependencies) increases install size and audit surface.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use hasown?
Yes — hasown scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 104 days ago. 2 releases in the last 2 years.
How do I install hasown?
Run `npm install hasown` to add hasown to your npm project.
How many dependencies does hasown have?
hasown declares 17 direct dependencies and pulls in 1 packages in total once its runtime tree is resolved totalling about 41 KB on disk.
What license is hasown released under?
hasown is distributed under the MIT license.
How popular is hasown?
npm does not publish download counts. Within PackageGraph's crawl, 8 known packages depend on hasown.
Is hasown still maintained?
The most recent release of hasown (v2.0.4) was published 3 months ago.
Does hasown run install scripts?
No. hasown does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.