This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@nodesecure/dependa

1.0.0 • Public • Published

Dependa

Identify and categorize Node.js dependencies (builtins, alias, third parties..). The module and the code has been inspired by builtins and builtin-modules.

Features

  • Several ways to use the API (get and is) to allow any kind of custom code.
  • First class support of Node.js protocol node:.
  • Wider API not limited or restricted to Node.js core modules.

Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm i @nodesecure/dependa
# or
$ yarn add @nodesecure/dependa

Usage example

import * as dependa from "@nodesecure/dependa";

console.log(dependa.is.builtins("node:fs/promises"));
console.log(dependa.is.builtins("stream"));

const builtins = dependa.get.builtins();
console.log(builtins);

API

is.builtins(moduleName: string): boolean

Return true if the given moduleName is a Node.js core dependency.

is.subpath(moduleName: string): boolean

Return true if the given moduleName is a Subpath import (starting with #).

is.filesystem(moduleName: string): boolean

Return true if the given moduleName is a filesystem dependency (starting with /, ./ or ../).

is.thirdparty(moduleName: string): boolean

Return true if the given moduleName is a third-party dependency (which mean the module is not a subpath, builtins or filesystem).

get.builtins(options): Set< string >

Return an ES6 Set of all Node.js builtins (core dependency).

get.kind(moduleName: string): "subpath" | "filesystem" | "builtins" | "thirdparty"

Return the kind of the given module name.

Contributors

All Contributors

Thanks goes to these wonderful people (emoji key):


Gentilhomme

💻

License

MIT

Package Sidebar

Install

npm i @nodesecure/dependa

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

9.41 kB

Total Files

6

Last publish

Collaborators

  • antoine-coulon
  • fraxken
  • kawacrepe
  • pierred
  • tonygo