Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
基于http/1.1-chunked + async实现的一种数据分块加载技术。
Either through forking or by using npm (the recommended way):
npm install data-chunk
And data-chunk will be installed in to your node-project.
// ...
var dc = require('data-chunk');
app.get('/', function(req, res, next){
res.render('index', function(error, html){
res.write(html); //先加载页面框架dom,并开启chunked模式
dc.response(res); //设置下dc所需要的response
dc.dcseries({
one: function(callback){
setTimeout(function(){
callback(null, 1);
}, 200);
},
two: function(callback){
setTimeout(function(){
callback(null, 2);
}, 100);
}
},
function(err, results) {
console.log(results);
//此时已经自动调用res.end(),不必显示加载
// results is now equal to: {one: 1, two: 2}
});
});
//如果有前端库ICAT,数据会存放在ICAT.PAGEDATA中;如果无,则存放在window.PAGEDATA中
});
同async的所有方法;
同async的所有方法;
以上方法会自动获取每条task数据,写入PAGEDATA
同async的所有方法;
MIT
FAQs
data chunked
We found that data-chunk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.