这款插件就比较重量级了….用熟悉了写原生JS的效率要提升很多……而且,不仅支持JS还包含了nodejs snippet
插件作者: zenorocha
Github地址 : https://github.com/zenorocha/atom-javascript-snippets
内置了丰富的JS snippet . 而且也很好理解和记忆…耍多了会上手的
console.dir(${1:obj});
console.error(${1:obj});
console.log(${1:obj});
console.warn(${1:obj});
${1:document}.addEventListener('${2:event}', function(e) {
${0:// body...}
});
${1:document}.appendChild(${2:elem});
${1:document}.removeChild(${2:elem});
${1:document}.createElement(${2:elem});
${1:document}.createDocumentFragment(${2:elem});
${1:document}.classList.add('${2:class}');
${1:document}.classList.toggle('${2:class}');
${1:document}.classList.remove('${2:class}');
${1:document}.getElementById('${2:id}');
${1:document}.getElementsByClassName('${2:class}');
${1:document}.getElementsByTagName('${2:tag}');
${1:document}.getAttribute('${2:attr}');
${1:document}.setAttribute('${2:attr}', ${3:value});
${1:document}.removeAttribute('${2:attr}');
${1:document}.innerHTML = '${2:elem}';
${1:document}.textContent = '${2:content}';
${1:document}.querySelector('${2:selector}');
${1:document}.querySelectorAll('${2:selector}');
${1:myArray}.forEach(function(${2:elem}) {
${0:// body...}
});
for (${1:prop} in ${2:obj}) {
if (${2:obj}.hasOwnProperty(${1:prop})) {
${0:// body...}
}
}
function ${1:methodName} (${2:arguments}) {
${0:// body...}
}
function(${1:arguments}) {
${0:// body...}
}
${1:ClassName}.prototype.${2:methodName} = function(${3:arguments}) {
${0:// body...}
}
(function(window, document, undefined) {
${0:// body...}
})(window, document);
${1:methodName}.call(${2:context}, ${3:arguments})
${1:methodName}.apply(${2:context}, [${3:arguments}])
${1:functionName}: function(${2:arguments}) {
${3:// body...}
}
setInterval(function() {
${0:// body...}
}, ${1:delay});
setTimeout(function() {
${0:// body...}
}, ${1:delay});
assert.equal(${1:actual}, ${2:expected});
assert.deepEqual(${1:actual}, ${2:expected});
assert.notEqual(${1:actual}, ${2:expected});
module.exports = ${1:name};
process.exit(${1:code});
require('${1:module}');
describe('${1:description}', function() {
${0:// body...}
});
it('${1:description}', function(done) {
${0:// body...}
});
it('${1:description}', function() {
${0:// body...}
});
it('${1:description}');
'use strict';
alert('${1:msg}');
prompt('${1:msg}');
这些用熟悉了…. 写代码的速度不说提升百分百…但是增加20%还是有的;
而且还有一个好处,不会出现代码漏打字符,打错字符的情况..毕竟模版写死了;
除非参数传错了…..
我也在学习的路上,,,,慢慢的充实自己……………………………