condense-newlines

WebJar for condense-newlines

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

condense-newlines
Последняя версия

Последняя версия

0.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

condense-newlines
WebJar for condense-newlines
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/jonschlinkert/condense-newlines

Скачать condense-newlines

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/condense-newlines/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>condense-newlines</artifactId>
    <version>0.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/condense-newlines/
implementation 'org.webjars.npm:condense-newlines:0.2.1'
// https://jarcasting.com/artifacts/org.webjars.npm/condense-newlines/
implementation ("org.webjars.npm:condense-newlines:0.2.1")
'org.webjars.npm:condense-newlines:jar:0.2.1'
<dependency org="org.webjars.npm" name="condense-newlines" rev="0.2.1">
  <artifact name="condense-newlines" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='condense-newlines', version='0.2.1')
)
libraryDependencies += "org.webjars.npm" % "condense-newlines" % "0.2.1"
[org.webjars.npm/condense-newlines "0.2.1"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.webjars.npm : extend-shallow jar [2.0.1,3)
org.webjars.npm : is-whitespace jar [0.3.0,0.4)
org.webjars.npm : kind-of jar [3.0.2,4)

Модули Проекта

Данный проект не имеет модулей.

condense-newlines NPM version NPM downloads Build Status

Replace extraneous newlines with a single newline, or pass a specified number of newlines to use.

Install

Install with npm:

$ npm install condense-newlines --save

Usage

var condense = require('condense-newlines');
console.log(condense('\n\na\n\n\nb\nc\r\n\r\nd\n\n\n'));
//=> '\na\nb\nc\nd\n';

Options

options.sep

Specify the separator to use

console.log(condense('\n\na\n\n\nb\nc\r\n\r\nd\n\n\n', {sep: '\n\n'}));
//=> '\n\na\n\nb\n\nc\n\nd\n\n';

options.min

The minimum number of consecutive newlines to condense.

Default

: 2

console.log(condense('\n\na\n\n\nb\nc\r\n\r\nd\n\n\n', {min: 2}));
//=> '\n\na\n\nb\n\nc\n\nd\n\n';

options.keepWhitespace

Don't treat whitespace-only lines as newlines.

console.log(condense('\n\na\n\n      \nb\nc\r\n\r\nd\n\n\n', {
  keepWhitespace: true, sep: '\n\n'
}));

//=> '\n\na\n\n      \nb\n\nc\n\nd\n\n';

Related projects

You might also be interested in these projects:

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on April 23, 2016.

Версии библиотеки

Версия
0.2.1