meteor怎样使用外部的js库

94 views
Skip to first unread message

魏永清

unread,
Sep 4, 2012, 12:38:35 AM9/4/12
to cn-met...@googlegroups.com
1、使用客户端的库,如moment.min.js库,在根文件夹下建lib文件夹,放到里边,meteor默认先加载lib中的文件。
2、用nodejs的库,npm点击
Yes, it is possible. You can use an npm module in Meteor, since it's based on Node.js.

This code has worked for me fine, e.g.:

var fs = __meteor_bootstrap__.require('fs');

UPDATE: To install an npm module in a Meteor app

  1. Inside your terminal, change path to your Meteor app directory.
  2. > cd .meteor/local/build/server
  3. Install an npm module like so > npm install module_name.
Reply all
Reply to author
Forward
0 new messages