To install through Package Control, search for JavaScript & NodeJS Snippets. If you still don't have Package Control in Sublime Text, go get it. It's pure awesomeness.
If you insist to not install it, you can download the package and put it manually inside your Packages
directory. It should work but will not update automatically.
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}');
${1:document}.removeChild('${2}');
${1:document}.createElement('${2:elem}');
${1:document}.createDocumentFragment();
${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}';
${1:document}.textContent = '${2}';
${1:document}.querySelector('${2:selector}');
${1:document}.querySelectorAll('${2:selector}');
${1:myArray}.forEach(function (${2:elem}) {
${0:// body...}
});
[].forEach.call(document.querySelectorAll(${1:selector}), function (${2:elem}) {
${0:// body...}
});
for (var ${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})
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}
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...}
});
'use strict';
prompt('${1:msg}');
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Check Release list.
MIT License © Zeno Rocha