record

2019-09-20 admin

record是什么

什么是record,The canonical implementation of the node-task Record specification.

record使用教程帮助文档

record Build Status

The canonical implementation of node-task’s Record specification

Usage

var Record = require('record');

var file = new Record({
  path: 'path/to/file',
  encoding: 'utf8',
  contents: 'i will be turned into a buffer'
});

constructor(options)

options.path

Path to file.

Type: String Default: null

options.contents

File contents.

Type: Buffer, Stream, or null Default: null

options.encoding

A default encoding to be used with toString().

type()

Return the type of Record. (Null, Buffer, ReadableStream, etc).

isNull()

Return true if the record contents are null.

isBuffer()

Return true if the record contents are a Buffer.

isStream()

Return true if the record contents are a Stream.

clone()

Return a clone of the record.

toString()

For usage with Buffer backed records only. Calls toString() on the underlying buffer. If no encoding is provided, the Record’s optional encoding property will be used. If neither is available, will default to utf8 encoding.

pipe(stream[, opt])

  • If the record contents are a Buffer, it will be written to the provided stream.
  • If the record contents are a Stream, pipe them to the provided stream.
  • If the record contents are null, this will do nothing.
  • If opt.end is true, the destination stream will not be ended.

Returns the provided stream.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-75607.html

文章标题:record

相关文章
MongoDB - what is the fastest way to update all records in a collection?
JohnnyHKmattjvincent提出了一个问题:MongoDB - what is the fastest way to update all records in a collection?,或许与您遇到的问题类似。 回答者Gat...
2018-04-11
typescript进阶篇之高级类型与条件类型(Readonly, Partial, Pick, Record)
本文所有东西尽可在 typescript 官网文档寻找,但是深浅不一 高级类型 lib 库中的五个高级类型 以下所有例子皆以 person 为例 interface Person { name: string; age?...
2019-06-04
优化Recorder H5录音:可边录边转码上传服务器,支持微信提供Android IOS Hybrid App源码
Recorder H5 GitHub开源库随着支持功能的增多,音频转码处理效率渐渐的跟不上需求了,近期抽时间对音频转码部分进行了升级优化,以支持更多实用的功能。 另外IOS的Hybrid App也完成了移植,Android和IOS都有了D...
2019-08-26
brisky-recorder
brisky-recorder是什么 什么是brisky-recorder,Record and play back vigour-state events brisky-recorder官网:官网 brisky-recorder源码仓库...
2019-08-03
can-observation-recorder
can-observation-recorder是什么 什么是can-observation-recorder,Records observations between two points in time can-observation...
2019-09-21
回到顶部