Socket
Socket
Sign inDemoInstall

@nodesecure/dependa

Package Overview
Dependencies
3
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nodesecure/dependa

Identify and categorize Node.js dependencies (builtins, third parties..)


Version published
Weekly downloads
0
decreased by-100%
Maintainers
4
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 09 Jul 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc