- 响应式设计,支持桌面端和手机端自适应 - 首页展示轮播图、推荐歌单、热门歌曲、新碟上架、热门歌手 - 歌曲/歌手/专辑/歌单详情页 - 底部播放器:播放/暂停、上下首、进度拖动、音量控制 - 歌词同步滚动显示 - 搜索功能 - 后台管理 /admin - JSON文件存储
mimic-response 
Mimic a Node.js HTTP response stream
Install
$ npm install mimic-response
Usage
const stream = require('stream');
const mimicResponse = require('mimic-response');
const responseStream = getHttpResponseStream();
const myStream = new stream.PassThrough();
mimicResponse(responseStream, myStream);
console.log(myStream.statusCode);
//=> 200
API
mimicResponse(from, to)
Note #1: The from.destroy(error) function is not proxied. You have to call it manually:
const stream = require('stream');
const mimicResponse = require('mimic-response');
const responseStream = getHttpResponseStream();
const myStream = new stream.PassThrough({
destroy(error, callback) {
responseStream.destroy();
callback(error);
}
});
myStream.destroy();
Please note that myStream and responseStream never throws. The error is passed to the request instead.
from
Type: Stream
to
Type: Stream
Any stream.
Related
- mimic-fn - Make a function mimic another one
- clone-response - Clone a Node.js response stream
Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.