Skip to content

un-ts/cf-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b71e8b5 · Mar 24, 2025

History

43 Commits
Oct 27, 2023
Sep 20, 2022
Oct 27, 2023
Oct 27, 2023
Oct 27, 2023
Oct 13, 2021
Sep 20, 2022
Dec 9, 2021
Oct 14, 2021
Oct 13, 2021
Sep 20, 2022
Dec 9, 2021
Oct 13, 2021
Sep 20, 2022
Mar 24, 2025
Oct 13, 2021
Oct 27, 2023
Oct 13, 2021
Oct 27, 2023
Sep 20, 2022
Oct 27, 2023
Oct 27, 2023
Sep 20, 2022
Sep 20, 2022

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