squeak

WebJar for squeak

Лицензия

Лицензия

MIT
Группа

Группа

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

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

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

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

1.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

squeak
WebJar for squeak
Ссылка на сайт

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

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

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

https://github.com/kevva/squeak

Скачать squeak

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

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

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : chalk jar [0.5.1,0.6)
org.webjars.npm : lpad-align jar [1.0.1,2)

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

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

squeak Build Status

A tiny stream log

Install

$ npm install --save squeak

Usage

var Squeak = require('squeak');
var log = new Squeak()
	.type('info')
	.type('success', {color: 'green'})
	.type('warn', {color: 'yellow'})
	.type('error', {color: 'red'}, function () {
		log.end();
		process.exit(1);
	});

log.info('this is a info message');
log.success('this is a success message');
log.warn('this is a warning');
log.error(new Error('this is an error').stack);

/*
     info : this is a info message
  success : this is a success message
     warn : this is a warning
    error : this is an error
    at ChildProcess.exithandler (child_process.js:648:15)
    at ChildProcess.emit (events.js:98:17)
 */

You can also customize the different types to use a custom prefix using the prefix option:

var Squeak = require('squeak');
var log = new Squeak({separator: ' '})
	.type('success', {color: 'green', prefix: '✔'})
	.type('warn', {color: 'yellow', prefix: '⚠'});

log.success('this is a success message');
log.warn('this is a warning');

/*
  ✔ this is a success message
  ⚠ this is a warning
 */

API

new Squeak(options)

Creates a new Squeak instance.

options.align

Type: boolean
Default: true

Whether to align the prefixes or not. E.g:

     foo : hello
  foobar : world

options.indent

Type: number
Default: 2

Sets the indentation.

options.separator

Type: string
Default: :

Customize the separator between the prefix and the message.

options.stream

Type: stream
Default: process.stderr

Which stream to write to.

.write(args)

Type: string

Writes to options.stream, using process.stderr by default.

.writeln(args)

Type: string

Same as .write() but with a new line.

.writelpad(args)

Type: string

Same as .write() but with padding.

.type(type, options, callback)

Adds a type.

type

Type: string

The name of the type. Will be used as prefix by default.

options.color

Type: string

Sets the prefix color. Supported colors can be found here.

options.prefix

Type: string

Sets the type prefix. Uses type by default.

callback

Type: function

An optional callback to be called when the type is called.

.emit(event, data)

Emits an event.

.end(callback)

Type: function

Writes a newline and executes an optional callback function.

License

MIT © Kevin Mårtensson

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

Версия
1.2.0