codecamp

Atom 开发Node模块

开发Node模块

Atom中的一些包是Node模块,而不是Atom的包。如果你想要修改这些Node模块,例如atom-keymap,你需要把它们链接到不同于普通Atom包的开发环境中。

把Node模块链接到你的Aton开发环境

下面是运行node模块的本地版本的步骤,而不是Atom中的apm。我们使用atom-keymap作为一个例子:

$ git clone https://github.com/atom/atom-keymap.git
$ cd atom-keymap
$ npm install
$ npm link
$ apm rebuild # This is the special step, it makes the npm work with Atom's version of Node
$ cd WHERE-YOU-CLONED-ATOM
$ npm link atom-keymap
$ atom # Should work!

然后,当你修改了node模块的代码时,你必须运行npm installapm rebuild

Atom Atom中的序列化
Atom 通过服务和其它包交互
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }