npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dx-pkg/mksymlink

v1.0.17

Published

Create symbolic links across platforms (macOS, Windows)

Readme

@dx-pkg/mksymlink

Cross-platform symbolic link creation tool for macOS, Windows, and Linux.

Features

  • Cross-platform support - Works on macOS, Windows, and Linux
  • Git-like configuration - Manage settings with mksymlink config
  • Flexible symlink creation - Auto-generated or custom paths
  • Configurable defaults - Set your preferred symlink directory once
  • Windows symlink types - Support for file, directory, and junction
  • Force overwrite - Replace existing symlinks when needed
  • CLI & Programmatic API - Use from command line or Node.js

Installation

npm install -g @dx-pkg/mksymlink

Quick Start

Create symlinks in the current directory (CWD)

Generate symlinks from any source directly into your current terminal session's directory.

# Explicitly define source and target
mksymlink -s ~/projects/my-app -t .

# Creates: ~/projects/my-app -> ./my-app
# Create a symlink of the current folder inside itself (or to a target)
cd ~/projects/my-app
mksymlink -t .

# Creates: ~/projects/my-app -> ~/projects/my-app/my-app

Save to a default directory

You can configure a global destination so you don't have to specify the target path every time.

# 1. Configure the default symlink destination
mksymlink config set symlink.defaultDir ~/my-symlinks

# 2. Run without arguments to use the default directory (configured at `symlink.defaultDir`)
cd ~/projects/my-app
mksymlink

# Creates: ~/projects/my-app -> ~/my-symlinks/projects--my-app

CLI Commands

mksymlink (alias as mksymlink create)

mksymlink create

Create symlink with full control over source and target.

mksymlink create -s <source> -t <target> [--type <type>] [-f]

mksymlink config

Manage configuration settings.

mksymlink config <get|set|unset|list|info> [key] [value]

📖 Detailed Documentation:

Programmatic API

Configuration API

import { ConfigService, ConfigCommandFactory } from '@dx-pkg/mksymlink';

// Using ConfigService directly
const config = new ConfigService();
config.set('symlink.defaultDir', '/path/to/symlinks');
const dir = config.getDefaultSymlinkDir();

// Using ConfigCommandFactory
const setCmd = ConfigCommandFactory.create({
    action: 'set',
    key: 'symlink.defaultDir',
    value: '/path/to/symlinks',
});
await setCmd.execute();

Symlink Creation API

import { MkSymlinkCommandFactory } from '@dx-pkg/mksymlink';

const command = MkSymlinkCommandFactory.create({
    source: '/path/to/source',
    target: '/path/to/target',
    type: 'dir',
    force: false,
});

await command.execute();

Advanced Usage

import { SymlinkService, PlatformDetector, ConsoleLogger } from '@dx-pkg/mksymlink';

const logger = new ConsoleLogger();
const osDetector = new PlatformDetector();
const symlinkManager = new SymlinkService(logger, osDetector);

const result = await symlinkManager.createSymlink({
    source: '/source/path',
    target: '/target/path',
    type: 'dir',
    force: true,
});

if (result.success) {
    console.log('Symlink created:', result.target);
} else {
    console.error('Failed:', result.message);
}

Windows Symlink Types

| Type | Description | Admin Required | | ---------- | -------------------------------- | -------------- | | dir | Directory symlink | Yes | | file | File symlink | Yes | | junction | Directory junction (recommended) | No |

# Recommended for directories (no admin)
mksymlink --type junction

# Requires administrator
mksymlink --type dir

📖 See: Create Command - Windows Types

Development

Build & Test

# Build
npm run build

# Test
npm test

# Lint & Format
npm run lint
npm run format

Testing CLI Commands

After building, test the CLI locally:

# Quick mode
npx mksymlink

# Config commands
npx mksymlink config set symlink.defaultDir ~/test-symlinks
npx mksymlink config list
npx mksymlink config get symlink.defaultDir
npx mksymlink config unset symlink.defaultDir
npx mksymlink config info

# Create mode
npx mksymlink create -s /path/to/source -t /path/to/target
npx mksymlink create -f
npx mksymlink create --type junction  # Windows