JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q59387F
  • License MIT

pins Yarn to a specific version and downloads it automatically on demand

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pinyarn) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    pinyarn

    npm version Twitter Follow

    pinyarn determines Yarn and Yarn plugins version used in the project and creates a script that downloads exactly this version from official Yarn repository even when global one changes.

    Usage

    npx pinyarn

    or if Yarn 2+ is already used with the project

    yarn dlx pinyarn

    or

    yarn dlx pinyarn 3

    to use latest stable version 3

    or

    yarn dlx pinyarn master

    to use latest version of Yarn 2+ from master

    or

    yarn dlx pinyarn 1030

    to use Yarn 2+ version from latest commit to the Pull Request 1030

    or

    yarn dlx pinyarn 4cd0bba

    to use Yarn 2+ from commit sha 4cd0bba

    How it works

    pinyarn computes URLs of Yarn and its plugins from where they can be downloaded and generates .pinyarn.js - a script to download Yarn and plugins from these URLs. The URLs will be placed in the config variable at the top of .pinyarn.js.

    GitHub access tokens used only when you use unreleased Yarn 2+ version from GitHub Actions build artifacts. You can generate your own list of GitHub access tokens and put them inside config variable at the top of .pinyarn.js, the only requirement to them is that they have public_repo permission. Please note that each token must be split into two or more pieces to prevent GitHub to autorevoke it. .yarnrc.js will pick the token from the list at random each time it will be needed to lower down chance of GitHub request throttling.

    pinyarn modifies your .yarnrc.yml by setting yarnPath to point to .pinyarn.js. Each time Yarn is run it launches the script pointed to by yarnPath. .pinyarn.js thus receives the control first and checks whether correct version of Yarn and plugins have been downloaded and if not downloads them, removes incorrect versions if any and passes control to Yarn binary.

    License

    Copyright © 2020 SysGears (Cyprus) Limited. This source code is licensed under the MIT license.