yokel
v1.0.4
Published
Manage local NPM dependencies with automatic linking for streamlined development workflows
Downloads
9
Maintainers
Readme
yokel 📦
The missing support for local package development workflow! Manage local NPM dependencies with automatic linking for streamlined development workflows.
yokel simplifies working with local NPM packages during development by automating the npm link workflow and maintaining a localDependencies section in your package.json.
Features
- 🔗 Automatic npm linking - Handles the entire
npm linkcycle automatically - 📝 package.json management - Maintains both
dependenciesandlocalDependenciessections - 🚀 Bulk operations - Install all local dependencies with a single command
- 🎯 Simple CLI - Intuitive commands that mirror npm's interface
- 🔄 Reversible - Easy unlinking of local dependencies
- 📊 Dependency listing - View all your local dependencies at a glance
Installation
Install globally to use across all your projects:
npm install -g yokelUsage
Install a Local Dependency
To add a local package as a dependency:
yokel install ../my-local-package
# or shorthand
yokel i ../my-local-packageThis command will:
- Read the
package.jsonfrom../my-local-package - Add the package to your
dependencieswith its current version - Add the path and version to
localDependencies - Run
npm linkin the local package directory - Run
npm link <package-name>in your current directory
Install All Local Dependencies
When you have existing localDependencies in your package.json:
yokel install
# or shorthand
yokel iThis will link all packages listed in localDependencies.
List Local Dependencies
View all your local dependencies:
yokel list
# or shorthand
yokel lsUnlink a Local Dependency
Remove a local dependency:
yokel unlink ../my-local-package
# or shorthand
yokel u ../my-local-packagepackage.json Structure
After installing a local dependency, your package.json will look like this:
{
"name": "my-project",
"version": "1.0.0",
"dependencies": {
"my-local-package": "^2.1.0"
},
"localDependencies": {
"../my-local-package": "^2.1.0"
}
}Using with npm Scripts
You can integrate yokel into your npm scripts, particularly useful in postinstall:
{
"scripts": {
"postinstall": "yokel install",
"dev:link": "yokel install",
"dev:unlink": "yokel unlink ../my-local-package"
}
}Use Cases
Monorepo Development
Perfect for monorepo setups where packages depend on each other:
# In packages/app
yokel i ../shared-utils
yokel i ../ui-componentsLibrary Development
Test your library in a real project before publishing:
# In your test project
yokel i ~/projects/my-awesome-libraryFeature Development
Work on a dependency feature without publishing:
# Link the dependency you're modifying
yokel i ../node_modules/some-package-forkHow It Works
yokel automates the traditional npm link workflow:
Traditional Workflow:
cd ../my-local-package
npm link
cd -
npm link my-local-package
# Manually edit package.jsonWith yokel:
yokel i ../my-local-package
# Done! ✅Advantages
- Persistence - Local dependencies are stored in
package.json, making them shareable with your team - Automation - The
postinstallhook can automatically link dependencies afternpm install - Clarity - The
localDependenciessection clearly shows which packages are linked locally - Version Tracking - Maintains version information for all local dependencies
