entrify
v1.0.1
Published
Library to convert package.json to index.js.
Downloads
3
Readme
entrify
📦 Library to convert package.json
to index.js
.
Some 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.
To remediate this situation we have to create an index.js
file for each of those package.json
. That's where entrify shines ✨.
💁 Hey! For the command line tool head to: entrify-cli.
Installation
npm install entrify --save
or
yarn add entrify
Usage
const path = require('path')
const entrify = require('entrify')
entrify(path.join(__dirname, './src/components'))
Documentation
entrify(directory)
directory
–String
. The directory to traverse.options
–Object
. Hash of options.format
–String
. Format of theindex.js
to create. Valid options are:cjs
andesm
.
Development
- Clone and fork this repo.
- Install dependencies: yarn or npm install.
- Run tests.
- Prepare a pull request.
Test
yarn test
– to run all tests.yarn test -- --watch
– to run all tests in watch mode.
Publish
- Bump package version:
yarn version --new-version x.x.x -m 'Version %s.'
. - Publish to NPM registry:
npm publish
. - Push new tag:
git push origin --tags
.
Made with :heart: by Rubens Mariuzzo.