trailing-newline

Check whether a string ends with a newline

MIT 1 个版本
安装
npm install trailing-newline
yarn add trailing-newline
pnpm add trailing-newline
bun add trailing-newline
README

trailing-newline Build Status

Check whether a string ends with a newline on Unix or Windows.

Installing

$ npm install trailing-newline

API

trailingNewline(text) -> Boolean

Checks whether the text ends in a newline character (\n or \r\n).

// unix
trailingNewline('Hello world\n') === true;

// windows
trailingNewline('Hello world\r\n') === true;
版本列表
1.0.0 2015-02-12