0.5.0 • Published 4 years ago

packito v0.5.0

Weekly downloads
64
License
MIT
Repository
github
Last release
4 years ago

📦 Packito

Build Status codecov NPM version License

Packito is a cli tool to clean package before publishing it.

Purpose

Before publishing to npm, did you take care of your package.json ?

  • devDependencies, some scripts and other entries("husky", ...) could be removed.
  • add some new or change entries, like "main" source file name
  • use a dist file and copy some extra files/directories in it (README.md, LICENSE, ...).
  • and finally publish your package using npm, np or lerna.

Simple using one command:

$ packito

By default it will remove "scripts" and "devDependencies", copy README.md and LICENSE if they exist to './dist' folder.

Install

$ yarn add --dev packito

Or using npm

$ npm add --dev packito

Usage

$ packito [options] [bin-to-publisher]

Options

namealiasdescription
--dist-dPath to publish from
--nopublish-nSkips publishing step
--help-hDisplays help informations

Bin to publisher

namedescription
npmPublish using npm
lernaPublish using npm
npPublish using np

.packito.json

It is the configuration file. This json should be at root of the project, a sample:

{
  "remove": {
    "devDependencies": "*",
    "scripts": "*",
    "type": true,
    "esm": true,
    "husky": true,
    "commitlint": true
  },
  "replace": {
    "main": "index.js",
    "module": "index.mjs"
  },
  "publisher":  "np"
}
nametypedescription
removeobjectall keys to remove from packages.json (if =true or ='*' replace all)
replaceobjectall keys+values to replace in packages.json
copyobjectall files to copy in dist
outputstringfolder to publish to
publisherstring|objectThe publisher to use (npm, np, lerna)

Other command examples

Publish to path 'publish'

$ packito -d ./publish

Publish to path 'publish' and use np patchto publish

$ packito -d ./publish np patch

Coded using state of the art and simplicity in mind

  • Simple to use
  • Modern ES6+ syntax (import instead of require, await/async, ...)
  • Follows Node best practices

Requirements

  • Node >= 10

Contribution

Read Contributing Guide for development setup instructions.

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago