Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kettek/submodules-install
NPM submodules installer
https://github.com/kettek/submodules-install
javascript node nodejs npm submodules
Last synced: about 1 month ago
JSON representation
NPM submodules installer
- Host: GitHub
- URL: https://github.com/kettek/submodules-install
- Owner: kettek
- Created: 2018-06-08T22:21:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-16T09:04:11.000Z (over 3 years ago)
- Last Synced: 2024-12-11T21:40:40.366Z (about 1 month ago)
- Topics: javascript, node, nodejs, npm, submodules
- Language: JavaScript
- Size: 12.7 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# submodules-install - NPM Submodules Installer
This module provides a system for calling `npm i`, `yarn install`, or a custom command on a list of locations, ultimately providing automatic submodule installation.## Usage
Install via npm:npm i submodules-install --save
Or Yarn:
yarn add submodules-install
Add an array of strings using glob syntax or specially formatted objects to your `package.json`:
"submodules": [
"my_subdir/*",
"my_subdir2/**",
{
"path": "my_subdir3",
"cmd": "go",
"args": ["build"]
}
]Then run:
npx submodules-install
Alternatively, you may also use `preinstall`, `postinstall`, or otherwise:
"scripts": {
"preinstall": "submodules-install"
}## Submodules Object
If an object is provided to the submodules array, it should match the following structure:```
{
path: String, // Target glob to search.
cmd: String, // Optional. Command to use to run the install. Defaults to npm or yarn if a `yarn.lock` file is found.
args: [String], // Optional. Arguments to pass to the command. Defaults to `i` under npm or `install` under yarn.
contains: String, // Optional. File to find in the glob result directory. Defaults to `package.json` if using npm or yarn.
}
```