├── .github └── workflows │ └── test.yml ├── .gitignore ├── .vscode ├── extensions.json └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── biome.json ├── deno.json ├── src └── index.ts └── tests ├── perf └── benchmark │ ├── baseline.js │ ├── benchmark.js │ └── package.json └── unit ├── examples.test.ts ├── html.test.ts └── plain-text.test.ts /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: 3 | push: 4 | branches: [main] 5 | pull_request: 6 | branches: [main] 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | 14 | - name: Setup Biome 15 | uses: biomejs/setup-biome@v2 16 | with: 17 | version: "1.8.3" 18 | 19 | - name: Lint and formatting 20 | run: biome ci . 21 | 22 | - name: Set up Deno 23 | uses: denoland/setup-deno@v1 24 | with: 25 | deno-version: 1.x 26 | 27 | - name: Run tests 28 | run: deno test 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | package-lock.json 4 | yarn.lock 5 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["biomejs.biome", "denoland.vscode-deno"] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "deno.enable": true, 3 | "editor.defaultFormatter": "biomejs.biome" 4 | } 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ## 3.0.0 4 | 5 | - `text-clipper` has become a Deno-first library and is now available on [Jsr.io](https://jsr.io). 6 | Instructions for installation on Node.js/Bun are still included. 7 | - Fix #18: Don't include spaces before the indicator. 8 | - Fix #19: Introduce a new option `insertIndicatorAtLinebreak` (default: `true`). If you want to 9 | keep the behavior of `text-clipper` v2, you should set this back to `false`. 10 | - Tweak in behavior: The indicator is never inserted if only whitespace remains after the 11 | clipping point. 12 | 13 | ## 2.2.0 14 | 15 | - Implement #14: Add `stripTags` option. 16 | - Tiny Unicode fix. 17 | - Treat `