Eject npm dependencies to your source code
npm install eject-dependenciesIf 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.













Install the package globally from npm:
``bash`
npm install --save-global eject-dependencies
Use the CLI:
`bash
eject-dependencies
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
``