Skip to content

un-ts/cf-cleaner

Repository files navigation

cf-cleaner

GitHub Actions Codecov type-coverage npm GitHub Release

Conventional Commits Renovate enabled JavaScript Style Guide Code Style: Prettier changesets

Cleanup Confluence HTML via rehype

TOC

Usage

Install

# npm
npm i -g cf-cleaner

# pnpm
pnpm i -g cf-cleaner

# yarn
yarn global add cf-cleaner

CLI

Usage: cfc [options] [input]

Arguments:
  input                   Input HTML codes

Options:
  -V, --version           output the version number
  -i, --input <path>      Input HTML file
  -o, --output <path>     Output HTML file
  -m, --minify [boolean]  Whether to minify HTML output
  -h, --help              display help for command

API

import fs from 'fs'
import { cleaner } from 'cf-cleaner'

// string
const output = cleaner(html, minify, encoding)

// stream
cleaner(fs.createReadStream(htmlFile), minify).pipe(
  fs.createWriteStream(outputFile),
)

Changelog

Detailed changes for each release are documented in CHANGELOG.md.

License

MIT © JounQin@1stG.me