- 授权协议: Apache
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/facebook/node-haste
软件介绍
Node-Haste 是 node.js 中的静态资源管理扩展包。
它旨在给定目录的情况下建立或更新地图上的静态资源。对于静态资源,如: JS, CSS, Images, Tests, 等,一旦这些资源被发现,它会比较 mtimes 并更新已有的映射关系,同时它也会检查 package.json 配置;最后解析受影响的文件并提取相关的有用信息,如:依赖关系、处理选项、大小等。一旦静态资源被扫描则会将新数据更新到地图上面。
示例:
var Haste = require('node-haste').Haste;
var loaders = require('node-haste').loaders;
// configure haste facade
var haste = new Haste(
[
new loaders.JSLoader({ networkSize: true }),
new loaders.CSSLoader({ networkSize: true }),
new ProjectConfigurationLoader(),
new ResourceLoader()
],
['html']
);
// return current map, utilizing cache if available
haste.update('.cache', function(map) {
assert(map instanceof ResourceMap);
});