Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eol

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eol

Newline character converter

  • 0.10.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5M
decreased by-10.57%
Maintainers
0
Weekly downloads
 
Created

What is eol?

The eol npm package is designed to handle end-of-line (EOL) characters in strings, making it easier to manage cross-platform newline characters in a consistent manner. It provides utilities to convert, detect, and remove line endings.

What are eol's main functionalities?

Convert to specific EOL type

Converts all end-of-line characters in a string to Unix line endings (LF). Useful for ensuring consistent EOL characters in a multi-platform development environment.

const eol = require('eol');

let unixText = eol.lf('Hello\r\nWorld'); // Converts to LF (\n) line endings

Auto-detect and normalize EOL

Automatically detects and normalizes the end-of-line characters in a string to the system's default EOL setting. This is particularly useful for handling text input from various sources with differing EOL conventions.

const eol = require('eol');

let normalizedText = eol.auto('Hello\r\nWorld'); // Normalizes to the default system EOL

Remove all EOL characters

Strips all end-of-line characters from a string, which can be useful for creating single-line strings from multiline input.

const eol = require('eol');

let cleanText = eol.strip('Hello\r\nWorld'); // Removes all EOL characters

Other packages similar to eol

Keywords

FAQs

Package last updated on 01 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc