Giter Site home page Giter Site logo

yarnrc's Introduction

yarnrc

Switch between different .yarnrc files with ease and grace.

Overview

This is an adapted version of npmrc(npmrc) to work with the new package manager released by Facebook known as Yarn. If you use a private npm registry, you know the pain of switching between a bunch of different .yarnrc files and manually managing symlinks. Let that be a problem no more! yarnrc is here to save the day, by making it dead simple to switch out your .yarnrc with a specific named version. It also tries to protect you from your own stupid self by making sure you don't accidentally overwrite an .yarnrc that you actually want to keep.

Installation

npm install -g yarnrc

Usage

➜  ~  yarnrc --help

yarnrc

  Switch between different .yarnrc files with ease and grace.

Usage:
  yarnrc                 list all profiles
  yarnrc [name]          change yarnrc profile (uses fuzzy matching)
  yarnrc -c [name]       create a new yarnrc profile called name
  yarnrc -r [registry]   use an npm mirror

Available mirrors for yarnrc -r:
  au      - Australian registry mirror
  eu      - European registry mirror
  cn      - Chinese registry mirror
  default - Default registry

Initialisation

Calling yarnrc without arguments creates an ~/.yarnrcs/ directory if it doesn't exist, and copies your current ~/.yarnrc as the 'default' .yarnrc profile.

➜  ~  yarnrc
Creating /Users/conrad/.yarnrcs
Making /Users/conrad/.yarnrc the default yarnrc file
Activating .yarnrc 'default'

Create a new .yarnrc profile

➜  ~  yarnrc -c newprofile
Removing old .yarnrc (/home/rvagg/.yarnrcs/default)
Activating .yarnrc 'newprofile'

A blank profile will be created. To point your profile to a non-default registry:

➜  ~  npm config set registry http://npm.nodejs.org.au:5984/registry/_design/app/_rewrite

Then use npm adduser or npm login to authenticate with the new profile.

List available .yarnrc profiles

➜  ~  yarnrc
Available yarnrcs:

* default
  work

Switch to a specific .yarnrc

➜  ~  yarnrc work
Removing old .yarnrc (/Users/conrad/.yarnrcs/default)
Activating .yarnrc 'work'

You can also pass only the first few characters of a profile and yarnrc will autocomplete the profile's name.

➜  ~  yarnrc def
Removing old .yarnrc (/Users/conrad/.yarnrcs/work)
Activating .yarnrc 'default'

yarnrc <name> will also go to some lengths to make sure you don't overwrite anything you might care about:

➜  ~  yarnrc default
Removing old .yarnrc (/Users/conrad/.yarnrcs/work)
Activating .yarnrc 'default'
➜  ~  yarnrc default  
Current .yarnrc (/Users/conrad/.yarnrc) is already 'default' (/Users/conrad/.yarnrcs/default)
➜  ~  rm ~/.yarnrc
➜  ~  touch ~/.yarnrc
➜  ~  yarnrc default
Current .yarnrc (/Users/conrad/.yarnrc) is not a regular file, not removing it
➜  ~  rm ~/.yarnrc
➜  ~  yarnrc default
Activating .yarnrc 'default'

Note For Windows Users

You may have to run yarnrc in a shell (cmd, PowerShell, Git Bash, etc) with elevated (Administrative) privileges to get it to run.

Environment Variables

  • YARNRC_STORE - Path to directory of profiles. Default: ~/.yarnrcs/
  • YARNRC - Path to the yarnrc file used by npm. Default: ~/.yarnrc

Known npm registry Mirrors

For your convenience, you can change registries easily using the -r flag. Currently we provide aliases for:

Switching registry example

➜  ~  npm -r eu
Using eu registry
➜  ~  npm info yarnrc
npm http GET http://registry.npmjs.eu/yarnrc
^C
➜  ~  npm -r default
Using default registry
➜  ~  npm info yarnrc
npm http GET https://registry.npmjs.org/yarnrc
^C

License

3-clause BSD. A copy is included with the source.

Contact

Awesome People

  • deoxxa "the creator" of npmrc(github)
  • Jaime "the binary wizard" Pillora (github)
  • Tim "two hands" Oxley (github)
  • Jakob "fastest blur in the west" Krigovsky (github)
  • Rod "the destroyer" Vagg (github)
  • Eugene "ludicrous gibs" Asiedu (github)

yarnrc's People

Contributors

timoxley avatar deoxxa avatar sonicdoe avatar nanaeasiedu avatar vitorcamachoo avatar rvagg avatar dylang avatar jpillora avatar dead-horse avatar

Stargazers

wubaiqing avatar C avatar João Cháchá avatar  avatar Jorge Barnaby avatar william avatar Johan Borestad avatar Pana avatar Rob Howell avatar Ernst Salzmann avatar Pascal Duez avatar Vítor Camacho avatar Miguel Freitas avatar Mathieu M-Gosselin avatar Rodolfo Gonçalves avatar Diogo Spínola avatar cz avatar Masaya Kamakura avatar Milos Dakic avatar crapthings avatar azu avatar Mrs_L avatar Dirk-Jan Wassink avatar Dmytro Piddubnyi avatar Alban Minassian avatar Andrea Parodi avatar  avatar Eisi Sig avatar

Watchers

R. Alvez avatar  avatar

yarnrc's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

yarnrc fails to create a new profile

From Usage instructions: "Calling yarnrc without arguments creates an ~/.yarnrcs/ directory if it doesn't exist, and copies your current ~/.yarnrc as the 'default' .yarnrc profile."

But in my case it does not. The response is: /usr/bin/env: ‘node\r’: No such file or directory

If I instead use : yarnrc -c newprofile I get : bash: /home/myuser: Is a directory

Could this be related to the fact that my global npm repository is ~/home/myuser/.node_modules_global instead of default used by node?
I've changed it to avoid having to use sudo every time I want to install a global package.
I use ArchLinx and I've have an up-to-date system.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.