Skip to content
JS
Package

trim-newlines

Trim newlines from the start and/or end of a string

v5.0.0, 20 Mar 2023MITESM onlyTypes: Bundled
$ npm install trim-newlines

Key numbers

As of 25 Sept 2026
Weekly downloads
14.9m
+6% over 12 months
Gzip bundle size
-
No Bundlephobia data
Dependencies
0
Direct, from package.json
Last release
3 years ago
v5.0.0
GitHub stars
49
39 forks
Open issues / PRs
0 / 0
Contributors
-
Commits, last 52 weeks
1

Downloads

Last week 2026-09-15 to 2026-09-21
05m10m15m20mSept 2025Mar 2026Sept 2026High 19.6m (21 Jul 2026)Low 7.2m (23 Dec 2025)
Weekly npm downloads, one point per week, weeks starting 23 Sept 2025 to 15 Sept 2026. The y axis starts at zero.

14,866,074 downloads last week, 68,849,004 in the last month. The 12-month change of +6% compares the average of the last 4 weeks with the first 4 weeks of the series.

Releases, last 12 months
010 in total
Latest version
5.0.0, 20 Mar 20233 years ago
First published
29 Sept 2015
Last push to GitHub
18 Sept 20266 days before the snapshot
Repository archived
No
Open issues
0
Open pull requests
0
Commits, last 52 weeks
1
Dependents on npm
578

Major versions

  1. v5 first release 5.0.0, 20 Mar 2023
  2. v4 first release 4.0.0, 21 Apr 2021
  3. v3 first release 3.0.0, 29 Apr 2019
  4. v2 first release 2.0.0, 22 Apr 2017
  5. v1 first release 1.0.0, 29 Sept 2015

Recent releases

VersionPublished
5.0.020 Mar 2023
4.1.120 Mar 2023
4.1.020 Mar 2023
4.0.210 Jun 2021
3.0.128 May 2021
4.0.128 May 2021
4.0.021 Apr 2021
3.0.029 Apr 2019
2.0.022 Apr 2017
1.0.029 Sept 2015
Module format
ESM onlyFrom package.json type, main and exports fields
TypeScript types
Bundled
Node.js engine range
>=14.16
Runtimes
-
Unpacked size (npm)
4.5 kB
Dependencies (0)
None
npm install trim-newlines
  • jsDelivrhttps://cdn.jsdelivr.net/npm/trim-newlines@5.0.0/
  • unpkghttps://unpkg.com/trim-newlines@5.0.0/
  • esm.shhttps://esm.sh/trim-newlines@5.0.0
Sources: npm registry, npm downloads API, GitHub API. Data fetched 25 Sept 2026.

Indexability: Not indexed (discovery only): no category.