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 prefer to install it manually, you can download the package and put it inside your Packages
directory. It should work but will not update automatically.
console.dir(${1:obj});
console.error(${1:obj});
console.info(${1:obj});
console.log(${1:obj});
console.warn(${1:obj});
debugger;
${1:document}.addEventListener('${2:event}', function(e) {
${3}
});
${1:document}.appendChild(${2:elem});
${1:document}.removeChild(${2:elem});
${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:elem}';
${1:document}.textContent = '${2:content}';
${1:document}.querySelector('${2:selector}');
${1:document}.querySelectorAll('${2:selector}');
${1:myArray}.forEach(function(${2:elem}) {
${3}
});
for (${1:prop} in ${2:obj}) {
if (${2:obj}.hasOwnProperty(${1:prop})) {
${3}
}
}
function ${1:methodName}(${2:arguments}) {
${3}
}
function(${1:arguments}) {
${2}
}
${1:ClassName}.prototype.${2:methodName} = function(${3:arguments}) {
${4}
}
(function(${1:window}, ${2:document}) {
${1}
})(${1:window}, ${2:document});
${1:methodName}.call(${2:context}, ${3:arguments})
${1:methodName}.apply(${2:context}, [${3:arguments}])
${1:functionName}: function (${2:arguments}) {
${3}
}
JSON.parse(${1:obj});
JSON.stringify(${1:obj});
setInterval(function() {
${2}
}, ${1:delay});
setTimeout(function() {
${2}
}, ${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() {
${2}
});
it('${1:description}', function(done) {
${2}
});
it('${1:description}', function() {
${2}
});
it('${1:description}');
'use strict';
alert('${1:msg}');
confirm('${1:msg}');
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 Releases for detailed changelog.
MIT License © Zeno Rocha