npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

crlf-es

v1.1.1

Published

Convert line endings

Readme

crlf-es

0 dependency, promise-based utility to convert files to CRLF or LF or get file endings for files or strings.

Uses all native NodeJS API's: util.parseArgs util.styleText fs.glob

Based on kolodny/crlf

CLI Usage

Set line endings

Use --set or -s

$ crlf-es ./files/**/*.txt -s CRLF

[ SKIPPED ] ./files/10.txt  (7 ms)
[ SKIPPED ] ./files/11.txt  (76 ms)
[ SKIPPED ] ./files/16.txt  (77 ms)
[ SKIPPED ] ./files/17.txt  (77 ms)
[ SKIPPED ] ./files/4.txt   (78 ms)
[ SKIPPED ] ./files/8.txt   (78 ms)
[ SKIPPED ] ./files/12.txt  (81 ms)
[ SKIPPED ] ./files/7.txt   (82 ms)
[ SUCCESS ] ./files/1.txt   (89 ms)
[ SUCCESS ] ./files/13.txt  (90 ms)
[ SUCCESS ] ./files/14.txt  (90 ms)
[ SUCCESS ] ./files/2.txt   (90 ms)
[ SUCCESS ] ./files/15.txt  (91 ms)
[ SUCCESS ] ./files/3.txt   (91 ms)
[ SUCCESS ] ./files/5.txt   (91 ms)
[ SUCCESS ] ./files/6.txt   (91 ms)
[ SUCCESS ] ./files/9.txt   (91 ms)

Done in 133 ms

* Files are skipped when they are already a certain line ending or have no newlines (override with --force/-f)

Get line endings

$ npx crlf-es ./files/**/*.txt

./files/1.txt   LF
./files/10.txt  CRLF
./files/11.txt  CRLF
./files/13.txt  LF
./files/14.txt  LF
./files/15.txt  LF
./files/16.txt  CRLF
./files/17.txt  CRLF
./files/2.txt   LF
./files/3.txt   LF
./files/4.txt   CRLF
./files/5.txt   LF
./files/6.txt   LF
./files/8.txt   CRLF
./files/9.txt   LF
./files/12.txt  None
./files/7.txt   None

Done in 53 ms

API Usage

Set line endings in file

import { setLineEndings } from 'crlf-es';

await setLineEndings('./my-file.txt', 'CRLF');

Set line endings in multiple files

import { setLineEndings } from 'crlf-es';

// Uses NodeJS fs.glob
await setLineEndings('./files/**/*.txt', 'LF');

// Also accepts array
await setLineEndings(['./files/**/*.txt', './other-files/**/*.txt'], 'CRLF');

Get line endings for file

import { getFileLineEndings } from 'crlf-es';

await getFileLineEndings('./my-file.txt', 'LF');

Get line endings for string

import { getStringLineEndings } from 'crlf-es';

const myString =
    'Aut adipisci sit qui.\r\nEnim quibusdam accusamus cum fugiat.\r\nOfficiis qui veritatis facilis sint tempora impedit';

const result = await getStringLineEndings(myString);
// result = CRLF