</>PackageGraphPackageGraph

hasown

npmv2.0.4TypeScript

A 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.

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.

41 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 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.

PackageWeekly downloadsDependentsLicenseLast release
hasownthis page08MIT3 months ago
es-define-property131.3M4MIT1 day ago
define-data-property02MIT1 day ago
gopd07MIT1 day ago
eslint138.4M279MIT1 day ago
call-bind80.7M5MIT1 day ago

Dependencies

Declared by hasown v2.0.4. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (16)

@arethetypeswrong/cli ^0.18.2@ljharb/eslint-config ^22.2.3@ljharb/tsconfig ^0.3.2@types/function-bind ^1.1.10@types/tape ^5.8.1auto-changelog ^2.5.1eslint ^10.4.0evalmd ^0.0.19in-publish ^2.0.1jiti ^0.0.0mock-property ^1.1.0npmignore ^0.3.5nyc ^10.3.2safe-publish-latest ^2.0.0tape ^5.9.0typescript next

Used by

Popular packages that depend on hasown.

Relationship graph

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

Frequently installed together

Release history

2 releases in the last two years, typically about 113 days apart.

Recent versions of hasown
VersionPublishedSizeLicense
2.0.4latest3 months ago10 KBMIT
2.0.34 months ago9.8 KBMIT
2.0.22 years ago8.6 KBMIT
2.0.12 years ago11 KBMIT
2.0.02 years ago11 KBMIT
1.0.112 years agoMIT

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

Keywords

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.