find-node-modules

WebJar for find-node-modules

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

find-node-modules
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

find-node-modules
WebJar for find-node-modules
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/callumacrae/find-node-modules

Download find-node-modules

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/find-node-modules/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>find-node-modules</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/find-node-modules/
implementation 'org.webjars.npm:find-node-modules:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.npm/find-node-modules/
implementation ("org.webjars.npm:find-node-modules:1.0.4")
'org.webjars.npm:find-node-modules:jar:1.0.4'
<dependency org="org.webjars.npm" name="find-node-modules" rev="1.0.4">
  <artifact name="find-node-modules" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='find-node-modules', version='1.0.4')
)
libraryDependencies += "org.webjars.npm" % "find-node-modules" % "1.0.4"
[org.webjars.npm/find-node-modules "1.0.4"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : findup-sync jar [0.4.2]
org.webjars.npm : merge jar [1.2.0,2)

Project Modules

There are no modules declared in this project.

find-node-modules

This is a little node module to find the path of every parent node_modules directory. It's useful for things like Sass, where you can't specify the exact path to individual modules (in which case findup-sync would be sufficient), and you can't just give an array of parent node_modules which might exist, because it will error if they don't.

In most cases you're trying to find node_modules directories, findup-sync should be sufficient. This library is specifically for if you want an array containing all the parent node_modules paths. If you loop through the output of this library, you should be using findup-sync instead.

Install

$ npm install --save find-node-modules

Usage

var findNodeModules = require('find-node-modules');

findNodeModules();
//=> ['node_modules', '../../node_modules']

findNodeModules({ cwd: './someDir' });
//=> ['../node_modules', '../../../node_modules']

findNodeModules('./someDir');
//=> ['../node_modules', '../../../node_modules']

findNodeModules({ cwd: './someDir', relative: false });
//=> ['/path/to/something/node_modules', '/path/node_modules']

License

This is released under the MIT license.

Versions

Version
1.0.4