{"id":15893919,"url":"https://github.com/chinanf-boy/explain-yarn","last_synced_at":"2026-05-17T17:10:17.921Z","repository":{"id":90548255,"uuid":"114863675","full_name":"chinanf-boy/explain-yarn","owner":"chinanf-boy","description":"explain --\u003e yarn - manger your project ","archived":false,"fork":false,"pushed_at":"2017-12-20T08:44:13.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T18:47:54.407Z","etag":null,"topics":["explain","explain-yarn","yarn"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chinanf-boy.png","metadata":{"files":{"readme":"README-src.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-20T08:40:50.000Z","updated_at":"2017-12-20T08:44:44.000Z","dependencies_parsed_at":"2023-07-18T11:32:36.547Z","dependency_job_id":null,"html_url":"https://github.com/chinanf-boy/explain-yarn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chinanf-boy/explain-yarn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fexplain-yarn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fexplain-yarn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fexplain-yarn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fexplain-yarn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinanf-boy","download_url":"https://codeload.github.com/chinanf-boy/explain-yarn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fexplain-yarn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33147342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["explain","explain-yarn","yarn"],"created_at":"2024-10-06T08:14:04.419Z","updated_at":"2026-05-17T17:10:17.903Z","avatar_url":"https://github.com/chinanf-boy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yarn-src\n\n[![explain](http://llever.com/explain.svg)](https://github.com/chinanf-boy/Source-Explain)\n\nexplain-yarn ``\"version\": \"1.3.2\"``\n\nyarn解释-全目录\n\n- [yarn-bin/yarn.js](./README.md)\n\n- [yarn-src/](README-src.md) \u003c--- 你在这里\n\n``yarn`` 的 ``star`` 基本是 ``npm`` 的两倍了\n\n---\n\n本章节\n\n## 目录\n\n- [命令行](#命令cli)\n\n\n\n---\n\n## 命令cli\n\n[src/cli/index.js](yarn/src/cli/index.js)\n\n[代码1-13](yarn/src/cli/index.js)\n\n``` js\n/* @flow */\n\nimport http from 'http'; \nimport net from 'net';\nimport path from 'path';\n// 上面内置函数\n\nimport commander from 'commander'; // tj 命令行解析\nimport fs from 'fs';\nimport invariant from 'invariant';\n//在开发中提供描述性错误的一种方法，但在生产中存在一般性错误。\n\nimport lockfile from 'proper-lockfile';\nimport loudRejection from 'loud-rejection';\nimport onDeath from 'death';\nimport semver from 'semver';\n\n```\n\n### \u003e commander\n\n[try/try_commander.js](./try/try_commander.js)\n``` js\n#!/usr/bin/env node\n\nvar program = require('commander');\n\nprogram\n  .version('0.1.0')\n  .option('-p, --peppers', 'Add peppers')\n  .option('-P, --pineapple', 'Add pineapple')\n  .option('-b, --bbq-sauce', 'Add bbq sauce')\n  .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n  .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log('  - peppers');\nif (program.pineapple) console.log('  - pineapple');\nif (program.bbqSauce) console.log('  - bbq');\nif (program.cheese) console.log('  - ',program.cheese);\n\nconsole.log('  - %s cheese', program.cheese);\n```\n\n\u003etry\n\n```\nnpm run commander:try\n```\n\n### \u003e invariant\n\n[try/try_invariant.js](./try/try_invariant.js)\n``` js\nvar invariant = require('invariant');\n\ninvariant(true, 'This will not throw');\n// 没有\n\ninvariant(false, 'This will throw an error with this message');\n// Error: Invariant Violation: This will throw an error with this message\n```\n\n\u003etry\n\n```\nnpm run invariant:try\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fexplain-yarn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinanf-boy%2Fexplain-yarn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fexplain-yarn/lists"}