{"id":14965894,"url":"https://github.com/usulpro/read-pkg-workspace","last_synced_at":"2025-04-06T00:31:11.016Z","repository":{"id":57319580,"uuid":"121497881","full_name":"usulpro/read-pkg-workspace","owner":"usulpro","description":"parses yarn-workspace folder structure","archived":false,"fork":false,"pushed_at":"2018-02-15T16:46:48.000Z","size":185,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-27T04:21:55.952Z","etag":null,"topics":["file","find","folder","json","matching","nested","npm","package","parse","path","relative-path","resolve","search","structure","workspace","workspaces","yarn","yarn-packages","yarn-workspaces","yarnpkg"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usulpro.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-14T10:26:41.000Z","updated_at":"2022-10-09T12:01:30.000Z","dependencies_parsed_at":"2022-08-25T22:41:22.475Z","dependency_job_id":null,"html_url":"https://github.com/usulpro/read-pkg-workspace","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usulpro%2Fread-pkg-workspace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usulpro%2Fread-pkg-workspace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usulpro%2Fread-pkg-workspace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usulpro%2Fread-pkg-workspace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usulpro","download_url":"https://codeload.github.com/usulpro/read-pkg-workspace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419597,"owners_count":20936009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["file","find","folder","json","matching","nested","npm","package","parse","path","relative-path","resolve","search","structure","workspace","workspaces","yarn","yarn-packages","yarn-workspaces","yarnpkg"],"created_at":"2024-09-24T13:35:31.962Z","updated_at":"2025-04-06T00:31:10.480Z","avatar_url":"https://github.com/usulpro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# read-pkg-workspace\n\u003e Read the closest two package.json files and checks if they are organized in a workspace\n\n- Supports Yarn [workspaces](https://yarnpkg.com/en/docs/workspaces)\n- Based on [read-pkg-up](https://github.com/sindresorhus/read-pkg-up)\n\n## Install\n\n```sh\nnpm i read-pkg-workspace --save\n```\n\n## Usage\n\n```js\nconst readPkgWsp = require('read-pkg-up');\n\nconst dir = '.../yarn-workspace-folder/packages/package-A/src/...';\n\nreadPkgWsp({ cwd: dir })\n  .then(result =\u003e console.log(result))\n\n```\n\n```console\n\n  result:\n    { package:\n       { pkg:\n          { name: 'celestabelleabethabelle',\n            description: 'the unicorn',\n            version: '1.0.0',\n            main: 'src/index.js',\n            license: 'MIT',\n            keywords: [Array],\n            optDependencies: [Object],\n            readme: 'ERROR: No README data found!',\n            _id: 'celestabelleabethabelle@1.0.0' },\n         path: '/home/usulpro/WebProjects/read-pkg-workspace/workspaces/unicorns/celestabelleabethabelle/package.json',\n         tailPath: 'src/stories',\n         relativePath: 'unicorns/celestabelleabethabelle' },\n      workspace:\n       { pkg:\n          { private: true,\n            workspaces: [Array],\n            name: '',\n            version: '',\n            readme: 'ERROR: No README data found!',\n            _id: '@' },\n         path: '/home/usulpro/WebProjects/read-pkg-workspace/workspaces/package.json',\n         name: 'workspaces' },\n      path: '/home/usulpro/WebProjects/read-pkg-workspace' }\n\n```\n\nWhere\n\n  `result.package.pkg` - is result of `read-pkg-up` for `package.json` located in the project folder\n\n  `result.workspace.pkg` - is result of `read-pkg-up` for `package.json` located in the workspace root folder\n\n  `result.package.relativePath` - is the relative path from workspace folder to the project folder\n\n  `result.package.tailPath` - is the relative path from project folder to the specified in argument `cwd` folder\n\n  `result.workspace.name` - the name of workspace root folder\n\n  `result.path` - path to the folder that contain the workspace root folder\n\n\n## This package is under development now\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusulpro%2Fread-pkg-workspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusulpro%2Fread-pkg-workspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusulpro%2Fread-pkg-workspace/lists"}