https://github.com/anandchowdhary/eject-dependencies
🪂 CLI to eject your npm dependencies to your source code
https://github.com/anandchowdhary/eject-dependencies
cli dependencies eject nodejs npm typescript
Last synced: 5 months ago
JSON representation
🪂 CLI to eject your npm dependencies to your source code
- Host: GitHub
- URL: https://github.com/anandchowdhary/eject-dependencies
- Owner: AnandChowdhary
- License: mit
- Created: 2020-03-25T16:09:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-15T21:39:34.000Z (almost 2 years ago)
- Last Synced: 2025-04-26T22:25:41.248Z (about 1 year ago)
- Topics: cli, dependencies, eject, nodejs, npm, typescript
- Language: TypeScript
- Homepage: https://anandchowdhary.github.io/eject-dependencies/
- Size: 254 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🪂 Eject dependencies
If you have dependencies in your `node_modules` folder, this package copies them to your source directory and changes all import references. It's like create-react-app's `eject` function but for all or some dependencies.
[](https://github.com/AnandChowdhary/eject-dependencies/actions)
[](https://travis-ci.org/AnandChowdhary/eject-dependencies)
[](https://coveralls.io/github/AnandChowdhary/eject-dependencies?branch=master)
[](https://libraries.io/npm/eject-dependencies)
[](https://github.com/AnandChowdhary/eject-dependencies/blob/master/LICENSE)
[](https://snyk.io/test/npm/eject-dependencies)
[](https://github.com/AnandChowdhary/eject-dependencies)
[](https://unpkg.com/browse/eject-dependencies/dist/index.d.ts)
[](https://www.npmjs.com/package/node.ts)
[](https://www.npmjs.com/package/node.ts)
[](https://github.com/AnandChowdhary/eject-dependencies/graphs/contributors)
[](https://github.com/semantic-release/semantic-release)
[](https://www.npmjs.com/package/eject-dependencies)
## 💡 Usage
Install the package globally from [npm](https://www.npmjs.com/package/eject-dependencies):
```bash
npm install --save-global eject-dependencies
```
Use the CLI:
```bash
eject-dependencies
# With configuration (see options below)
eject-dependencies --source-dir './node_modules'
```
Or, use without installation using `npx`:
```bash
npx eject-dependencies
```
Or, use programmatically with the API:
```ts
import { eject } from "eject-dependencies";
// Default
eject();
// With configuration
eject({ sourceDir: "./node_modules" });
```
## Configuration
| Option | Description | Example value |
| ----------------------- | ----------------------------------------- | ------------------------------ |
| `sourceDir` | `string` with dependencies dir | `"./node_modules"` |
| `destDir` | `string` with dir to copy in | `"./ejected"` |
| `codeFiles` | `string[]` with glob files | `["src/**/*.{js,jsx"]` |
| `updateTestFiles` | `boolean` to also update specfiles | `true` |
| `dependenciesFilter` 📦 | `Function` to filter dependencies (`Set`) | `dependencies => dependencies` |
_📦 → This option is only supported by the API, not the CLI_
## 👩💻 Development
Build TypeScript:
```bash
npm run build
```
Run unit tests and view coverage:
```bash
npm run test-without-reporting
```
## 📄 License
[MIT](./LICENSE) © [Anand Chowdhary](https://anandchowdhary.com)