Detalhes do pacote

string-remove-widows

codsen60.7kMIT4.0.25

Helps to prevent widow words in a text

against, copy, copywriting, email

readme (leia-me)

string-remove-widows

Helps to prevent widow words in a text

page on codsen.com page on npm page on github Downloads per month changelog MIT Licence

Install

This package is pure ESM. If you're not ready yet, install an older version of this program, 2.1.0 (npm i string-remove-widows@2.1.0).

npm i string-remove-widows

Quick Take

import { strict as assert } from "assert";

import { removeWidows } from "string-remove-widows";

const { ranges, res } = removeWidows("Some text with many words on one line.");

// see codsen.com/ranges/
assert.deepEqual(ranges, [[32, 33, " "]]);

assert.equal(res, "Some text with many words on one line.");

Documentation

Please visit codsen.com for a full description of the API.

Contributing

To report bugs or request features or assistance, raise an issue on GitHub.

Licence

MIT License.

Copyright © 2010-2025 Roy Revelt and other contributors.

ok codsen star

changelog (log de mudanças)

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

4.0.0 (2022-12-01)

BREAKING CHANGES

  • Minimum supported Node version is v14.18; we're dropping v12 support

3.1.0 (2022-08-12)

Features

3.0.17 (2022-04-18)

Fixed

3.0.0 (2021-09-09)

Features

BREAKING CHANGES

  • programs now are in ES Modules and won't work with Common JS require()

2.1.0 (2021-05-24)

Features

  • config file based major bump blacklisting (e15f9bb)

2.0.15 (2021-04-11)

Reverts

  • Revert "chore: setup refresh" (23cf206)

2.0.1 (2021-01-28)

Fixed

  • add testStats to npmignore (f3c84e9)

2.0.0 (2021-01-23)

Features

  • rewrite in TS, fix a typo (00475af)

BREAKING CHANGES

  • output object's log.timeTakenInMiliseconds had a typo, "l" missing, it's now log.timeTakenInMilliseconds

1.7.0 (2020-11-28)

Accidental version bump during migration to SourceHut. Sorry about that.

1.6.0 (2020-04-26)

Features

  • harden the linting rules set and rebase a little (2988292)

1.5.2 (2019-10-21)

Fixed

  • remove rogue require() which was present instead of import (233a8d1)

1.5.0 (2019-10-02)

Fixed

  • fix a case where nbsp could be replaced with itself (7ca664a)

Features

  • reporting res.whatWasDone - widow removal, decoding or both or neither (630a08d)

1.4.0 (2019-09-11)

Fixed

  • properly recognise single line breaks, not counts are reset correctly (ec5578b)

Features

  • add opts.ignore option "all" (a02dc78)
  • improvements to the algorithm (8a37c1d)

1.3.0 (2019-09-04)

Features

1.2.0 (2019-08-18)

Fixed

  • disable min char count setting so it's off by default (60aa23c)
  • further tweaks to m-dash rules (bec2683)

Features

  • enforce that nbsp's in front of dashes would be added only if whitespace follows that dash (9b23232)

1.1.0 (2019-08-08)

Features

  • init (29000b2)
  • opts.reportProgressFuncFrom and opts.reportProgressFuncTo (751c8d7)

1.0.0 (2019-08-07)

  • First public release