0

Is it possible to alias when running yarn link. Specifically when yarn link is run (As described here) and the package.json name attribute is contacto yarn link creates an executable command named contacto. But what if we it to be co instead such that users can run npm i contacto and subsequently use co as a command?

tk421
  • 5,775
  • 6
  • 23
  • 34
Ole
  • 41,793
  • 59
  • 191
  • 359

1 Answers1

0

Turns out it's really simple. In package.json just add:

 "bin": {"co": "./index.js"}

Then run npm i -g in the project directory and now co is part of your shell.

Ole
  • 41,793
  • 59
  • 191
  • 359