Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
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.
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
Similar to the 'strip' functionality of eol, newline-remove provides a method to remove all newline characters from a string. It does not, however, offer conversion between different types of EOL characters.
This package offers conversion between LF and CRLF line endings, similar to eol's conversion features. However, crlf-helper focuses specifically on these two types of line endings and does not include automatic detection or normalization to the system's default EOL.
npm install eol --save
var eol = require('eol')
eol.auto(text)
\r\n
or \n
eol.crlf(text)
\r\n
eol.lf(text)
\n
eol.cr(text)
\r
eol.before(text)
eol.after(text)
MIT
FAQs
Newline character converter
The npm package eol receives a total of 1,227,831 weekly downloads. As such, eol popularity was classified as popular.
We found that eol demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.