@p8ec/shared
v3.0.3
Published
P(8) Global Shared Library for Javascript
Readme
P(8) Shared Libraries for Node.js
Shared TypeScript/JavaScript libraries for P(8) products.
Shared Configuration
Shared (and very opinionated) configuration for P(8) projects.
Usage
Installation
npm i -D @p8ec/sharedInitialization
p8-cli initThis command will create the following files in your project and remove corresponding configuration entries
from package.json:
.eslintrc.cjs
/* eslint-disable */
module.exports = require('@p8ec/shared').eslintConfigRecommended;.prettierrc.cjs
/* eslint-disable */
module.exports = require('@p8ec/shared').prettierConfigRecommended;.commitlintrc.cjs
/* eslint-disable */
module.exports = { extends: ["@commitlint/config-conventional"] };P(8) CLI Tool
A command-line interface (CLI) tool for P(8) projects to simplify common tasks.
Syntax
p8-cli [command] [options]Commands
init- Initialize P(8) shared configuration in your project. Options:cleanup- remove configuration entries frompackage.json- Example:
p8-cli init --cleanup- initializes the shared configuration and removes corresponding entries frompackage.json.
- Example:
dirn- Get the directory name. Options:0- current directory (default),1- parent directory,2- 2 levels up directory, etc.- Example:
p8-cli dirn 1- shows the parent directory name.
- Example:
run- Returns a script string using the detected or specified package manager. Options:script- script name,packageManager-npm,yarn,pnpmorauto(detected by default),workspaceMode- mode of concurrency for workspaces (if applicable):seq,par,auto(detected by default).- Example:
p8-cli run build- returns thebuildscript using the detected package manager. - Example:
p8-cli run test auto par- returns thetestscript using the detected package manager in parallel mode for workspaces.
- Example:
pm- Returns the detected package manager (npm,yarn, orpnpm).ws- Returnstrueif the project is a workspace,falseotherwise.