@rootreeweb/rt-node-lib
v8.2.7
Published
A library of useful functions for managing Node.js packages.
Readme
Rootree Node Library
What is This?
The Rootree Node Library is a library of commonly used functions for managing Node.js packages. It provides functions for executing shell commands, versioning, bundling, and more!
Getting Started
The first step (if you haven't done so already) is to setup authentication for using our private packages. You can find instructions for doing that within the Rootree Web Wiki.
The second step is to add the library to your package file. This would typically be done with:
yarn add @rootreeweb/rt-node-libAdopt scripts as needed. For example, a script for updating versions in a mono-repo might look like this:
import path from "path"; import { updateVersion, VersionPresetPackage, } from "@rootreeweb/rt-node-lib"; const appsDir = path.resolve("apps"); const packagesDir = path.resolve("packages"); const files = [ { path: path.join(appsDir, "server", "package.json"), pattern: VersionPresetPackage, }, { path: path.join(appsDir, "client", "package.json"), pattern: VersionPresetPackage, }, { path: path.join(packagesDir, "db-connector", "package.json"), pattern: VersionPresetPackage, }, { path: path.join(packagesDir, "foundation-common", "package.json"), pattern: VersionPresetPackage, }, { path: path.join(packagesDir, "foundation-components", "package.json"), pattern: VersionPresetPackage, }, { path: path.join(appsDir, "entry-manager", "package.json"), pattern: VersionPresetPackage, }, { path: path.join("package.json"), pattern: VersionPresetPackage, }, ]; updateVersion(files);
Functions
Here are some functions that are available in the library:
- release(paths: string[], packageName: string, version: string)
- executeCommand( command: string, options: Pick<ExecOptions, T> )
Using the Quick Start
The quick start has been moved to the @rootreeweb/quick-start package.
