entrify

1.0.1 • Public • Published

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)

  • directoryString. The directory to traverse.
  • optionsObject. Hash of options.
    • formatString. Format of the index.js to create. Valid options are: cjs and esm.

Development

  1. Clone and fork this repo.
  2. Install dependencies: yarn or npm install.
  3. Run tests.
  4. Prepare a pull request.

Test

  • yarn test – to run all tests.
  • yarn test -- --watch – to run all tests in watch mode.

Publish

  1. Bump package version: yarn version --new-version x.x.x -m 'Version %s.'.
  2. Publish to NPM registry: npm publish.
  3. Push new tag: git push origin --tags.

Made with ❤️ by Rubens Mariuzzo.

MIT license

Readme

Keywords

none

Package Sidebar

Install

npm i entrify

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • rmariuzzo