</>PackageGraphPackageGraph

pirates

npmv4.0.7TypeScript

Properly hijack require, i.e., properly define require hooks and customizations

Adopt with care

pirates is usable, with caveats. Last published 531 days ago.

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

    No download data reported for this package yet.

  • CMaintenance: grade C, Fair — worth a look.

    Last published 531 days ago.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 12 KB installed.

  • ASupply chain: grade A, Excellent.

    No install scripts, 3 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 pirates to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

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

12 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
node >= 6
Module format
CommonJS only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the pirates README.

javascriptFull README ↗
// my-module/register.js
const addHook = require('pirates').addHook;
// Or if you use ES modules
// import { addHook } from 'pirates';

function matcher(filename) {
  // Here, you can inspect the filename to determine if it should be hooked or
  // not. Just return a truthy/falsey. Files in node_modules are automatically ignored,
  // unless otherwise specified in options (see below).

  // TODO: Implement your logic here
  return true;
}
Example truncated — see the full README.

Dependencies

Declared by pirates v4.0.7. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (2)

ava 1.4.1decache 4.6.2

Used by

Popular packages that depend on pirates.

Relationship graph

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

@jest/transformesbuild-registerpirates
pirates dependencies dependents

Frequently installed together

fast-json-stable-stringifynpm

deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify

137.5M/wk2 dependentsMITTS
jest-utilnpm

This packages is a collection of utilities and helper functions

104M/wk23 dependentsMITTS
jest-regex-utilnpm

No description provided.

74.9M/wk7 dependentsMITTS
@types/babel__corenpm

TypeScript definitions for @babel/core

0/wk9 dependentsMITTS
@jridgewell/trace-mappingnpm

Trace the original position through a source map

0/wk20 dependentsMITTS
slashnpm

Convert Windows backslash paths to slash paths

0/wk14 dependentsMITTS
jest-haste-mapnpm

`jest-haste-map` is a module used by Jest, a popular JavaScript testing framework, to create a fast lookup of files in a project. It helps Jest efficiently locate and track changes in files during testing, making it particularly useful for large projects

0/wk8 dependentsMITTS
graceful-fsnpm

A drop-in replacement for fs, making various improvements.

0/wk24 dependentsISC
babel-plugin-istanbulnpm

A babel plugin that adds istanbul instrumentation to ES6 code

0/wk6 dependentsBSD-3-Clause
write-file-atomicnpm

Write files in an atomic fashion w/configurable ownership

0/wk2 dependentsISC
@jest/typesnpm

This package contains shared types of Jest's packages.

0/wk26 dependentsMITTS
convert-source-mapnpm

Converts a source-map from/to different formats and allows adding/changing properties.

0/wk7 dependentsMIT

Release history

1 release in the last two years, typically about 41 days apart.

Recent versions of pirates
VersionPublishedSizeLicense
4.0.7latest1 year ago12 KBMIT
4.0.63 years ago13 KBMIT
4.0.54 years ago13 KBMIT
4.0.44 years ago13 KBMIT
4.0.34 years ago13 KBMIT
4.0.24 years ago7.6 KBMIT
4.0.17 years ago12 KBMIT
4.0.08 years ago11 KBMIT
3.0.28 years agoMIT
3.0.19 years agoMIT
3.0.09 years agoMIT
2.1.210 years agoMIT
2.1.110 years agoMIT
2.1.010 years agoMIT
2.0.110 years agoMIT

Overview

pirates is an npm package that properly hijack require, i.e., properly define require hooks and customizations. It has 2 known dependents in the graph. The latest version is 4.0.7, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need properly hijack require, i.e., properly define require hooks and customizations 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).
  • Lean dependency tree (2 direct dependencies).

Cons

  • No significant drawbacks detected from available metadata.

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

Maintainers

Frequently asked questions

Should I use pirates?

pirates is usable, with caveats. Last published 531 days ago.

How do I install pirates?

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

What license is pirates released under?

pirates is distributed under the MIT license.

How popular is pirates?

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

Is pirates still maintained?

The most recent release of pirates (v4.0.7) was published 1 year ago.

Does pirates run install scripts?

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