kley 🩹
A simple local package manager for npm (JS/TS)
Like
npm link, but with a more convenient workflow. Likeyalc, but without the dependency on Node.js.
English | Русский
kley is a command-line tool that simplifies local development of npm packages. It provides a robust alternative to npm link by managing a local package store, allowing you to "publish" packages to a central cache on your machine and "add" them to your projects via direct file copying. This avoids the common pitfalls of symbolic links.
Key Features
- Node.js Independent: Publish and install packages even if the library and the host project use different Node.js versions.
- Fast, Efficient, and Safe: Written in Rust for memory safety, security, and maximum performance.
- Reliable: Avoids symlink issues by copying files directly.
- Simple API: Three core commands to get started:
publish,add, andremove. - Cross-Platform: Works on macOS, Linux, and Windows.
Installation
Quick Install
You can install kley with a single command using the installer script:
# Linux / macOS
|
# Windows
Manual Installation
Alternatively, you can install kley by downloading a pre-compiled binary from the Releases page.
- Download the appropriate archive for your system (e.g.,
kley-x86_64-apple-darwin.tar.gz). - Unpack the archive.
- Move the
kleybinary to a directory in your system'sPATH(e.g.,/usr/local/binon macOS/Linux).
Usage
1. kley publish
Run this command in the directory of the package you want to share locally. Kley copies all necessary files to a central store at ~/.kley/packages/<your-package-name>.
2. kley add <package-name>
Run this command in the project where you want to use your local package. Kley copies the package into a local ./.kley/ directory, then automatically updates your package.json and kley.lock.
- Use the
--devflag to add the package todevDependencies.
3. kley remove <package-name>
Run this command to cleanly remove a kley-managed dependency from your project. It will update package.json and kley.lock, and delete the package files from the ./.kley/ directory.
- Use the
--allflag to remove all kley-managed packages from the project.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
About
This project is inspired by great tools like yalc. The main advantage of kley is that it is a single, self-contained binary with no dependency on Node.js. This means you can manage packages regardless of your current Node.js version or any issues with npm itself.
Note: This project is in active development and currently supports only the basic commands. More features are coming soon!
License
This project is licensed under the MIT License - see the LICENSE file for details.