Skip to content

Commit

Permalink
Remove cli
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkGriffiths committed Nov 4, 2021
1 parent de6b071 commit caf497f
Show file tree
Hide file tree
Showing 171 changed files with 1,964 additions and 15,287 deletions.
379 changes: 179 additions & 200 deletions index.js

Large diffs are not rendered by default.

23 changes: 3 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"main": "index.js",
"types": "index.d.ts",
"type": "module",
"bin": {
"truwrap": "./truwrap.js"
},
"files": [
"index.js",
"index.d.ts",
Expand All @@ -22,7 +19,7 @@
"owner": "The Bespoke Pixel"
},
"scripts": {
"build": "rollup -c && chmod 755 truwrap.js && npm run readme",
"build": "rollup -c && npm run readme",
"test": "xo && c8 --reporter=text ava --timeout 2m",
"doc-serve": "documentation serve --watch --theme node_modules/documentation-theme-bespoke --github --config src/docs/documentation.yml --project-name $npm_package_name --project-version $npm_package_version src/index.js",
"doc-build": "documentation build --format html --output docs --theme node_modules/documentation-theme-bespoke --github --config src/docs/documentation.yml --project-name $npm_package_name --project-version $npm_package_version src/index.js",
Expand All @@ -33,16 +30,13 @@
},
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.6",
"@types/estree": "^0.0.50",
"ava": "^4.0.0-rc.1",
"c8": "^7.10.0",
"documentation-theme-bespoke": "^2.0.12",
"nyc": "^15.1.0",
"rollup": "^2.59.0",
"rollup-plugin-cleanup": "^3.2.1",
"semver-regex": "^4.0.2",
"xo": "^0.46.3"
},
"dependencies": {
Expand All @@ -51,18 +45,8 @@
"@thebespokepixel/string": "^2.0.1",
"ansi-regex": "^6.0.1",
"columnify": "^1.5.4",
"common-tags": "^1.8.0",
"es6-promisify": "^7.0.0",
"get-stdin": "^9.0.0",
"lodash": "^4.17.21",
"os-locale": "^6.0.1",
"read-pkg": "^7.0.0",
"read-pkg-up": "^9.0.0",
"term-ng": "^3.0.3",
"trucolor": "^2.0.4",
"update-notifier": "^5.1.0",
"verbosity": "^3.0.2",
"yargs": "^17.2.1"
"read-pkg": "^7.0.0"
},
"engines": {
"node": ">=14.0"
Expand All @@ -89,7 +73,6 @@
"esnext": true,
"ignores": [
"index.js",
"truwrap.js",
"index.d.ts",
"docs/**",
"coverage/**"
Expand Down Expand Up @@ -151,4 +134,4 @@
]
]
}
}
}
39 changes: 1 addition & 38 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,45 +41,8 @@ Usable within your own node.js cli projects and an npm module or directly from t
npm install --save @thebespokepixel/truwrap
```

#### CLI

```text
truwrap
Smarter terminal text wrapping (handles 24bit color)
Synopsis:
cat inputFile | truwrap [options]
Options:
-h, --help Display this help.
-v, --version Return the current version on stdout. -vv Return name & version.
-V, --verbose Be verbose. -VV Be loquacious.
-o, --stderr Use stderr rather than stdout
-l, --left Left margin
-r, --right Right margin
-w, --width Set total width. Overrides terminal window’s width.
-t, --truncate Truncate panel cells.
-m, --mode Wrapping mode
-s, --stamp Print arguments rather than stdin. printf-style options supported.
-p, --panel Render a tabular panel into the available console width.
-d, --delimiter The column delimiter when reading data for a panel.
-x, --regex Character run selection regex.
--color Force color depth --color=256|16m. Disable with --no-color
Usage:
Reads unformatted text from stdin and typographically applies paragraph wrapping it for the currently active tty.
```

To use, simply pipe in a body of text to wrap according to the supplied options.

```shell
cat readme.md | truwrap --left 6 --right 6 --mode soft
```

#### Programmatic usage

```js
var truwrap = require('truwrap')
import {truwrap} from '@thebespokepixel/truwrap'

var writer = truwrap({
left: 2,
Expand Down
10 changes: 0 additions & 10 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import resolve from '@rollup/plugin-node-resolve'
import cleanup from 'rollup-plugin-cleanup'

Expand All @@ -13,15 +12,6 @@ const config = [{
file: 'index.js',
format: 'es',
},
}, {
external,
plugins: [resolve(), json({preferConst: true}), commonjs(), cleanup()],
input: 'src/cli/index.js',
output: {
banner: '#! /usr/bin/env node',
file: 'truwrap.js',
format: 'es',
},
}]

export default config
87 changes: 0 additions & 87 deletions src/cli/help.js

This file was deleted.

Loading

0 comments on commit caf497f

Please sign in to comment.