{"id":16184607,"url":"https://github.com/rmariuzzo/entrify","last_synced_at":"2025-04-02T00:31:58.192Z","repository":{"id":57225751,"uuid":"111029379","full_name":"rmariuzzo/entrify","owner":"rmariuzzo","description":"📦  Library to convert package.json to index.js.","archived":false,"fork":false,"pushed_at":"2017-11-20T23:03:04.000Z","size":37,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T07:10:35.048Z","etag":null,"topics":["main","monorepo","package-json"],"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/rmariuzzo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-16T22:28:46.000Z","updated_at":"2021-05-04T19:37:16.000Z","dependencies_parsed_at":"2022-08-24T11:00:32.248Z","dependency_job_id":null,"html_url":"https://github.com/rmariuzzo/entrify","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmariuzzo%2Fentrify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmariuzzo%2Fentrify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmariuzzo%2Fentrify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmariuzzo%2Fentrify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmariuzzo","download_url":"https://codeload.github.com/rmariuzzo/entrify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222786539,"owners_count":17037514,"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":["main","monorepo","package-json"],"created_at":"2024-10-10T07:10:42.753Z","updated_at":"2024-11-02T23:21:27.202Z","avatar_url":"https://github.com/rmariuzzo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![entrify – Library to convert package.json to index.js.](banner.svg)\n\nSome project has a `package.json` for each of component directories. This is with the benefit to be able to indicate the a main file per directory, which is nice. However, some tools like prettier and eslint, and features as webpack resolve/alias will not work properly.\n\nTo remediate this situation we have to create an `index.js` file for each of those `package.json`. That's where **entrify** shines ✨.\n\n\u003e 💁 **Hey!** For the command line tool head to: [entrify-cli](https://github.com/rmariuzzo/entrify-cli).\n\n## Installation\n\n```shell\nnpm install entrify --save\n```\n\nor \n\n```shell\nyarn add entrify\n```\n\n## Usage\n\n```js\nconst path = require('path')\nconst entrify = require('entrify')\n\nentrify(path.join(__dirname, './src/components'))\n```\n\n**Before:**\n\n```\n src/components/\n  | -- button\n        | -- package.json   (the main field points to `Button.js`)\n        | -- Button.js\n```\n\n**After:**\n\n```\n src/components/\n  | -- button\n        | -- index.js       (created in place of the package.json, it exports `Button.js`)\n        | -- Button.js\n```\n\n## Documentation\n\n### `entrify(directory)`\n\n  - **`directory`** – `String`. The directory to traverse.\n  - **`options`** – `Object`. Hash of options.\n    - **`format`** – `String`. Format of the `index.js` to create. Valid options are: `cjs` and `esm`.\n\n## Development\n\n  1. Clone and fork this repo.\n  2. Install dependencies: yarn or npm install.\n  3. [Run tests](#test).\n  4. Prepare a pull request.\n\n### Test\n\n  - `yarn test` – to run all tests.\n  - `yarn test -- --watch` – to run all tests in watch mode.\n\n### Publish\n\n  1. Bump package version: `yarn version --new-version x.x.x -m 'Version %s.'`.\n  2. Publish to NPM registry: `npm publish`.\n  3. Push new tag: `git push origin --tags`.\n\n\u003cdiv align=center\u003e\n\nMade with :heart: by [Rubens Mariuzzo](https://github.com/rmariuzzo).\n\n[MIT license](LICENSE)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmariuzzo%2Fentrify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmariuzzo%2Fentrify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmariuzzo%2Fentrify/lists"}