【文件属性】:
文件名称:hyperspace:在客户端和服务器上呈现 html 流
文件大小:26KB
文件格式:ZIP
更新时间:2021-06-12 15:00:38
JavaScript
超空间
在客户端和服务器上呈现 html 流
在浏览器和服务器中使用相同的渲染逻辑来构建具有可索引实时更新的 SEO 友好页面。
该模块只是对流手册中流 的封装, 在内部而不是外部使用和 json。
例子
简单的
首先选择一个流数据源,它将为您提供记录并让您订阅更改提要。 在这个例子中,我们将使用从单个文本文件中读取以简化示例代码。
让我们从将在客户端和服务器上使用的渲染逻辑开始:
渲染.js:
var hyperspace = require ( 'hyperspace' ) ;
var fs = require ( 'fs' ) ;
var html = fs . readFileSync ( __dirname + '/static/row.html' ) ;
module . exports = function ( ) {
return hyperspace
【文件预览】:
hyperspace-master
----.travis.yml(94B)
----browser.js(8KB)
----example()
--------more()
--------prepend()
--------messages.js(547B)
--------simple()
--------feed()
----index.js(3KB)
----readme.markdown(13KB)
----package.json(1KB)
----test()
--------browser()
--------simple_buf.js(1KB)
--------simple_obj.js(1KB)
--------text_attr.js(1KB)
--------key.js(2KB)
----LICENSE(1KB)
----.npmignore(101B)
----lib()
--------key_of.js(597B)