简体   繁体   English

如何安装page.js

[英]How to install page.js

I want to use page.js in my project. 我想在我的项目中使用page.js. But I think its using some sort of build system so I am not getting a single page.js file that I include in the page and start using 但我认为它使用某种构建系统,所以我没有得到我在页面中包含的单个page.js文件并开始使用

page('/',index)

Any idea, how to use it. 任何想法,如何使用它。

In your terminal: 在您的终端:

npm install page

Then in node: 然后在节点中:

> var page = require('page')
undefined
> page
{ [Function: page]
  callbacks: [],
  base: [Function],
  start: [Function],
  stop: [Function],
  show: [Function],
  replace: [Function],
  dispatch: [Function],
  Context: [Function: Context],
  Route: [Function: Route] }

Is that what you are looking for? 那是你在找什么?

The actual client-side script is called index.js in the root directory of the bundle. 实际的客户端脚本在bundle的根目录中称为index.js . Just rename it to page.js and copy it to wherever you're keeping your library scripts. 只需将其重命名为page.js并将其复制到您保存库脚本的任何位置即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM