symlinkr
v0.0.1
Published
A CLI tool to create package symlinks similar to npm link
Maintainers
Readme
Symlinkr
A CLI tool to create package symlinks similar to npm link, but with more control over which files get linked.
Features
- Create global symlinks for packages (like
npm link) - Link global packages to local projects (like
npm link package-name) - Selective file linking using include patterns
- Support for
.linkignorefile to control which files get linked - Works with npm, yarn, pnpm and bun
- Automatic package restoration when unlinking
Installation
npm install -g symlinkrUsage
Basic Usage
- Register a package globally (from package directory):
symlinkr- Use a globally registered package in your project:
symlinkr package-name- Unlink a package:
# Unlink from global registry (run in package directory)
symlinkr unlink
# Unlink from project (run in project directory)
symlinkr unlink package-nameSelective File Linking
Using Include Patterns
You can specify which files to include when linking using the --include flag:
symlinkr --include "src/**/*.js" "dist/**/*"Using .linkignore
Create a .linkignore file in your package root to control which files get linked:
# Exclude everything by default
*
# Include specific directories or files
!src/**
!dist/**
!types/**
!package.json
# Exclude within included directories
src/**/*.test.js
src/**/*.spec.jsRules:
- Lines starting with
!are include patterns - Other lines are exclude patterns
package.jsonis always included- Patterns follow glob syntax
How It Works
Symlinkr creates symlinks in a similar way to npm link but provides more control over which files get linked. When using selective linking:
- Files are filtered based on include patterns or
.linkignorerules - Only matched files are symlinked to the global package directory
- The package can then be linked into projects like normal
Package Manager Support
Symlinkr automatically detects and works with:
- npm
- yarn
- pnpm
- bun
When unlinking a package that exists in your project's dependencies, Symlinkr will automatically restore the original package using your project's package manager.
License
MIT © Aimen Sahnoun (Aviatolabs)
