{"id":21259727,"url":"https://github.com/bmpickford/npm-workspaces-example","last_synced_at":"2026-05-19T03:04:33.317Z","repository":{"id":156343332,"uuid":"443706119","full_name":"bmpickford/npm-workspaces-example","owner":"bmpickford","description":"Full working example for npm 7+ workspaces","archived":false,"fork":false,"pushed_at":"2022-01-02T11:25:36.000Z","size":1086,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T06:42:51.771Z","etag":null,"topics":["monorepo","npm","npm-workspaces","workspaces"],"latest_commit_sha":null,"homepage":"","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/bmpickford.png","metadata":{"files":{"readme":"README.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":"2022-01-02T07:20:21.000Z","updated_at":"2022-01-03T08:40:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c196556-572f-4ccb-803e-7a2089ddbdf9","html_url":"https://github.com/bmpickford/npm-workspaces-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bmpickford/npm-workspaces-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmpickford%2Fnpm-workspaces-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmpickford%2Fnpm-workspaces-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmpickford%2Fnpm-workspaces-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmpickford%2Fnpm-workspaces-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmpickford","download_url":"https://codeload.github.com/bmpickford/npm-workspaces-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmpickford%2Fnpm-workspaces-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267569684,"owners_count":24109121,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["monorepo","npm","npm-workspaces","workspaces"],"created_at":"2024-11-21T04:15:06.062Z","updated_at":"2026-05-19T03:04:33.258Z","avatar_url":"https://github.com/bmpickford.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# npm 7+ workspaces monorepo example\n\nA simple monorepo template using es modules and npm workspaces. It contains 3 very simple modules, one containing a list of names, one exporting a function to select a random item from those names, and one containing a web component that displays that name.\n\n## Structure\n```bash\n|-example/ # Directory containing example project\n|-docs/ # Auto generated docs from typedoc\n|-packages/ # Library specific sub packages\n```\n\n### Packages\nA few different packages have been used to test and showcase different options.\n\n#### names\nList of names using default export\n\n#### function\nExported function for random name generator as a named export\n\n#### element\n[Lit](https://lit.dev/) Web Component\n\n## Dependencies\n * [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces/)\n * [eslint](https://eslint.org/)\n * [mocha](https://mochajs.org/)/[chai](https://www.chaijs.com/)\n * [husky](https://typicode.github.io/husky/#/)\n * [vite](https://vitejs.dev/) for building / dev server for the example\n * [typedoc](https://typedoc.org/) for docs. See [example](https://bmpickford.github.io/npm-workspaces-example/modules.html) output\n\n## How to\n\n#### Add another package\nAdd another folder under the packages directory and run `npm init`. Add the following options to the newly created `package.json`; `\"type\", \"module\", \"main\", \"exports\"`. It is also recommeded that the other fields present in the existing packages are also added, but are optional.\n\n#### Use a framework like react for one of the workspaces\nAdd the dependencies to the sub package, then run `npm install` in the root directory.\n\n#### Publish\nEnsure non publishable packages and libraries are marked with `\"private\": true`. This will ensure they are not published\n`npm publish --ws`\n\n#### Use Typescript\nCreate your tsconfig and source files, then update the `package.json` `\"main\"` and `\"types\"` fields, and optionally add `\"files\"` if the compiled js is outputted in another directory.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmpickford%2Fnpm-workspaces-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmpickford%2Fnpm-workspaces-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmpickford%2Fnpm-workspaces-example/lists"}