meta_package_manager.managers.yarn

class meta_package_manager.managers.yarn.Yarn[source]

Bases: meta_package_manager.base.PackageManager

name = "Node's yarn"
global_args = ['--no-progress', '--non-interactive', '--skip-integrity-check']
platforms = frozenset({'linux', 'macos', 'windows'})
requirement = '1.0.0'
get_version()[source]

Fetch version from yarn --version output.

parse(output)[source]
static parse_info(obj)[source]
property installed

Fetch installed packages from yarn list output.

► yarn global --json --no-progress --non-interactive            > --skip-integrity-check list --depth 0

 (...)
search(query, extended, exact)[source]

Call yarn info and only works for exact match.

Yarn maintainers have decided not to implement a dedicated search command: https://github.com/yarnpkg/yarn/issues/778#issuecomment-253146299

► yarn --no-progress --non-interactive --skip-integrity-check             > --json info python | jq
{
  "type": "inspect",
  "data": {
    "name": "python",
    "description": "Interact with python child process",
    "dist-tags": {
      "latest": "0.0.4"
    },
    "versions": [
      "0.0.0",
      "0.0.1",
      "0.0.2",
      "0.0.3",
      "0.0.4"
    ],
    "maintainers": [
      {
        "name": "drderidder",
        "email": "[email protected]"
      }
    ],
    "time": {
      "modified": "2017-09-16T05:26:13.151Z",
      "created": "2011-07-11T01:59:04.362Z",
      "0.0.0": "2011-07-11T01:59:05.137Z",
      "0.0.1": "2011-07-17T05:23:33.166Z",
      "0.0.2": "2011-07-20T03:42:50.379Z",
      "0.0.3": "2014-06-08T00:39:08.562Z",
      "0.0.4": "2015-01-25T02:48:07.820Z"
    },
    "author": {
      "name": "Darren DeRidder"
    },
    "repository": {
      "type": "git",
      "url": "git://github.com/73rhodes/node-python.git"
    },
    "homepage": "https://github.com/73rhodes/node-python",
    "bugs": {
      "url": "https://github.com/73rhodes/node-python/issues"
    },
    "readmeFilename": "README.md",
    "users": {
      "dewang-mistry": true,
      "goliatone": true,
      "sapanbhuta": true,
      "aditcmarix": true,
      "imlucas": true,
      "heyderpd": true,
      "ukuli": true,
      "chbardel": true,
      "asaupup": true,
      "nuwaio": true
    },
    "version": "0.0.4",
    "main": "./lib/python.js",
    "engines": {
      "node": ">= 0.4.1"
    },
    "gitHead": "69754aaa57658193916a1bf5fc391198098f74f6",
    "scripts": {},
    "dist": {
      "shasum": "3094e898ef17a33aa9c3e973b3848a38e47d1818",
      "tarball": "https://registry.npmjs.org/python/-/python-1.tgz"
    },
    "directories": {}
  }
}
global_dir
property outdated

Fetch outdated packages from yarn outdated output.

Raw CLI output samples:

► yarn --json --no-progress --non-interactive            > --skip-integrity-check outdated --cwd

 (...)
upgrade_cli(package_id=None)[source]

Return a bash-compatible full-CLI to upgrade a package.

upgrade_all_cli()[source]

Return a bash-compatible full-CLI to upgrade all packages.

cleanup()[source]

Remove the shared cache files.

See: https://yarnpkg.com/cli/cache/clean