Automated package installation
Install @roots/dependencies to your project.
Yarn:
yarn add @roots/dependencies --dev
npm:
npm install @roots/dependencies --save-dev
Import the Dependencies
manager and instantiate.
The base path is required.
import { Dependencies } from "@roots/dependencies";
const manager = new Dependencies(process.cwd());
Optionally, you may also provide handlers for messages and errors:
import { Dependencies } from "@roots/dependencies";
const manager = new Dependencies(process.cwd(), console.log, console.error);
Create and use a new client:
const client = await manager.getClient();
await this.client.install(`lodash`);
await this.client.uninstall(`lodash`);
Get the latest version of a package:
const version = await this.client.getLatestVersion(`lodash`);
install a specific version with an array or a formatted string ({signifier}@{version}
):
await this.client.install([`lodash`, `latest`]);
await this.client.install(`lodash@latest`);
Supports flags:
await this.client.install([`lodash`, `latest`], `--dev`);
Contributions are welcome from everyone.
We have contribution guidelines to help you get started.
@roots/dependencies is licensed under MIT.
Keep track of development and community news.
- Join us on Roots Slack by becoming a GitHub sponsor
- Participate on the Roots Discourse
- Follow @rootswp on Twitter
- Read and subscribe to the Roots Blog
- Subscribe to the Roots Newsletter
bud.js is an open source project and completely free to use.
However, the amount of effort needed to maintain and develop new features and projects within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider sponsoring Roots.