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 🙏

© 2024 – Pkg Stats / Ryan Hefner

devlink-cli

v1.0.6

Published

Command line interface and helper for devlink package.

Downloads

5

Readme

Servant devlink-cli

Pipeline Npm Downloads License Node Collaborators

What is it?

Devlink is a simple tool, that can create symbolic link in your system from source to destination file. Usage is really simple and can be used from command line with arguments, with .env file or config file. Devlink keeps original file, so you can always revert link operation by unlink operation, that's return previous file.

Devlink preview

Possible usages

  1. Simple as a link creator - Link with ability to remove link
  2. Instead of yarn or npm link feature - Yarn or npm link remove reference to previous installed package and create new one. And sometimes you need only link dist files or one particular file without removing whole package. Devlink can do it.
  3. Linking files from node_modules - Sometimes you need to link file from node_modules to another place in your project. Devlink can do it.

Installation and start!

1. Globally installed

You need the latest version of nodejs and then run:

npm install devlink-cli -g

Then you can run in any directory command for creating link, for example

devlink link /path/to/original.txt /path/to/linkedFile.txt

2. Locally installed

You need the latest version of nodejs and then run:

npm install devlink-cli

Then you can run in current directory:

"node_modules/.bin/devlink" link /path/to/original.txt /path/to/linkedFile.txt

or add devlink into package.json scripts and run it directly:

{
	"scripts": {
		"make-link": "devlink link /path/to/original.txt /path/to/linkedFile.txt"
	}
}

3. Installed with npx

You need the latest version of nodejs and then run

npx devlink-cli link /path/to/original.txt /path/to/linkedFile.txt

Command line API

Devlink has really simple command line api. You can use two modes. link and unlink. Link mode create link from source to destination files. Unlink mode remove links and return original files.

Creating link or links

devlink link /path/to/original.txt /path/to/linkedFile.txt

or more links

devlink link /path/to/original.txt /path/to/linkedFile.txt /path/to/original1.txt /path/to/linkedFile1.txt

Removing link or links

devlink unlink /path/to/original.txt

or more links

devlink unlink /path/to/original.txt /path/to/original1.txt

Using config .link.json

Devlink can use also config file .link.json in current directory. Config file is simple json file with array of links. For link mode, every first link is source and every second is destination. Source is path to original file and destination is path to linked file. For unlink mode, every link is path to original file. You can also specify mode in config file, but that's not recommend because is more suitable to specify mode in command line.

.link.json

{
	"mode": "link", //not recommend, use mode in commnad line
	"links": [
		"/path/to/original.txt",
		"/path/to/linkedFile.txt",
		"/path/to/original1.txt",
		"/path/to/linkedFile1.txt"
	],
	"unlinks": ["/path/to/original.txt", "/path/to/original1.txt"]
}

Using .env file

Devlink can use also environmental file .env in current directory. This file is simple key value file with links split by lines or comma. For link mode, every first link is source and every second is destination. Source is path to original file and destination is path to linked file. For unlink mode, every link is path to original file. You can also specify mode in environmental file, but that's not recommend because is more suitable to specify mode in command line.

.env

mode=link #not recommend, use mode in commnad line
links=/path/to/original.txt,/path/to/linkedFile.txt
links=/path/to/original1.txt,/path/to/linkedFile1.txt
unlinks=/path/to/original.txt
unlinks=/path/to/original1.txt

Node API

Devlink can be used also in nodejs. You can use link and unlink functions. Link function create link from source to destination files. Unlink function remove links and return original files. There are more ways how to use this api. It's implemented as functional, promise, throwable and with callbacks. For more information about api, see API documentation in devlink package.

Donate me

| QR | Paypal | | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | | |