Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@11ty/dependency-tree-esm

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@11ty/dependency-tree-esm

Finds all JavaScript ES Module dependencies from a filename.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

dependency-tree-esm

Returns an unordered array of local paths to dependencies of a Node ES module JavaScript file.

  • See also: dependency-tree for the CommonJS version.

This is used by Eleventy to find dependencies of a JavaScript file to watch for changes to re-run Eleventy’s build.

Installation

npm install --save-dev @11ty/dependency-tree-esm

Features

  • Ignores bare specifiers (e.g. import "my-package")
  • Ignores Node’s built-ins (e.g. import "path")
  • Handles circular dependencies
  • Returns an empty set if the file does not exist.

Usage

// my-file.js

// if my-local-dependency.js has dependencies, it will include those too
import "./my-local-dependency.js";


// ignored, is a built-in
import path from "path";
const { find } = require("@11ty/dependency-tree-esm");

find("./my-file.js");
// returns ["./my-local-dependency.js"]

FAQs

Package last updated on 25 Aug 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc