Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 11, 2024 via pnpm

escalade 3.1.1

A tiny (183B to 210B) and fast utility to ascend parent directories
Package summary
Share
0
issues
1
license
1
MIT
Package created
19 Jun 2020
Version published
13 Oct 2020
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
escalade@3.1.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of escalade 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does escalade do?

Escalade is a small and fast utility that ascends parent directories. With it, you can scale up the parent directories until you find the item you're searching for. Given an input file or directory, escalade continues executing your callback function until either the callback returns a truthy value, indicating it's located the item, or escalade has reached the system root directory, denoted as '/'. It's important to note that escalade only deals with direct ancestry and doesn't dive into parents' sibling directories.

How do you use escalade?

The usage of Escalade is straightforward and simple, as shown in the following examples. Firstly, you need to install the package in your project using npm package manager like so:

$ npm install --save escalade

After this, you can import and use it in your JavaScript files like so:

import { join } from 'path';
import escalade from 'escalade';

const input = join(__dirname, 'demo.js');

const pkg = await escalade(input, (dir, names) => {
  if (names.includes('package.json')) {
    return 'package.json';
  }
});

console.log(pkg);

In the code above, we're searching for a file named 'package.json' in the parent directories of 'demo.js'. If it's found, the full path of the file is logged to the console. If not, nothing happens.

In "sync" mode, you'll need to import from escalade/sync, and there's no need for the await keyword.

Where are the escalade docs?

The full documentation for Escalade, which includes further usage examples and details about its API, is available directly from the readme content on its GitHub repository. In case of any changes or updates to the package, the GitHub page will be the most up-to-date source of information.