staticfile / cli Goto Github PK
View Code? Open in Web Editor NEWStaticfile command line utility
License: MIT License
Staticfile command line utility
License: MIT License
这个项目目测没人管了,其实当初搞复杂了,直接套用 cdnjs 多好啊
自己搞一套出来是很吃力的,我弄了个插件,每个人都可以自己轻松用自己的七牛空间加速 cdnjs
$ Desktop sfile get -v 1.9.1 jquery
# 未找到jquery [undefined]
$ npm install -g sfile
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR! <html><body><h1>Moved</h1><a href="/package/sfile">/package/sfile</a>
npm ERR! at Object.parse (native)
npm ERR! at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:266:23)
npm ERR! at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:238:65)
npm ERR! at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:123:22)
npm ERR! at Request.emit (events.js:98:17)
npm ERR! at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:893:14)
npm ERR! at Request.emit (events.js:117:20)
npm ERR! at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:844:12)
npm ERR! at IncomingMessage.emit (events.js:117:20)
npm ERR! at _stream_readable.js:929:16
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "sfile"
npm ERR! cwd /Users/tangmonk/Documents/learn/nodejs_study/socket.io-chat_example
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.16
npm ERR! type unexpected_token
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR! { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "sfile"
npm ERR! cwd /Users/tangmonk/Documents/learn/nodejs_study/socket.io-chat_example
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.16
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/tangmonk/Documents/learn/nodejs_study/socket.io-chat_example/npm-debug.log
npm ERR! not ok code 0
请问怎么安装?
$ Desktop sfile get typo
#*
/usr/local/lib/node_modules/sfile/bin/sfile:86
lib.assets.forEach(function (asset) {
^
TypeError: Cannot call method 'forEach' of undefined
at /usr/local/lib/node_modules/sfile/bin/sfile:86:18
at Request.exports.get [as _callback] (/usr/local/lib/node_modules/sfile/lib/index.js:23:12)
at Request.init.self.callback (/usr/local/lib/node_modules/sfile/node_modules/request/request.js:129:22)
at Request.EventEmitter.emit (events.js:99:17)
at Request.onResponse (/usr/local/lib/node_modules/sfile/node_modules/request/request.js:873:14)
at Request.EventEmitter.emit (events.js:126:20)
at IncomingMessage.Request.onResponse.buffer (/usr/local/lib/node_modules/sfile/node_modules/request/request.js:824:12)
at IncomingMessage.EventEmitter.emit (events.js:126:20)
at IncomingMessage._emitEnd (http.js:366:10)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
*#
sfile 这个软件的功能就跟故意让人找不到东西似的。
C:\Users>sfile lodash
搜索 lodash 共有 2 个库,当前列出 2 个:
C:\Program Files\nodejs\node_modules\sfile\bin\sfile:178
list.add(lib, lib.base + lib.subLabel.grey);
^
TypeError: Cannot read property 'grey' of undefined
at C:\Program Files\nodejs\node_modules\sfile\bin\sfile:178:48
at Array.forEach (native)
at C:\Program Files\nodejs\node_modules\sfile\bin\sfile:170:19
at Request._callback (C:\Program Files\nodejs\node_modules\sfile\lib\index.j
s:7:12)
at Request.self.callback (C:\Program Files\nodejs\node_modules\sfile\node_mo
dules\request\request.js:129:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (C:\Program Files\nodejs\node_modules\sfile\node_modu
les\request\request.js:873:14)
at emitOne (events.js:82:20)
at Request.emit (events.js:169:7)
以前有的 现在是扯下了吗
sfile search []
search和get都报这个错误
$ Desktop sfile get typo.css
# 未找到typo.css [1.0]
$ Desktop sfile get typo.css -v 1.1
# 未找到typo.css [undefined]
http://staticfile.org/ 上是有不同版本的选择的。
那么在这个cli中,例如搜索 jquery 结果为目前的jQuery 2.x,如何选择jQuery 1.x 版本?
不凑资一下?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.