JavaScript / JS snippets for your Sublime Text 2 / 3 Fu.
Install via package control: http://wbond.net/sublime_packages/community Search for JavaScript Snippets or typically the keywords js or javascript are suitable. You can install manually be cloning into your Sublime package directory.
function (${1:arguments}) {
${0:// body...}
}
console.dir(${1:obj})${0}
console.error(${1:error})${0}
console.log(${1:msg})${0}
console.log(require('util').inspect(${1:obj}, true, ${2:10}, true))${0}
console.trace(${1:msg})${0}
function ${1:methodName} (${2:arguments}) {
${0:// body...}
}
(function () {
${0:// body...}
})();
module.exports = ${1}
Object.keys(${1:obj}).forEach(function (key) {
${0:// body...}
})
process.exit()
${1:ClassName}.prototype.${2:methodName} = function (${3:arguments}) {
${0:// body...}
}
require('${1:package}')${0}
setTimeout(function () {
${2:// body...}
}, ${1:millis})
setInterval(function () {
${2:// body...}
}, ${1:millis})
'use strict'
describe('${1:description}', function () {
${0:// body...}
})
it('${1:description}', function (done) {
${0:// body...}
})
it('${1:description}', function () {
${0:// body...}
})
Uses JavaScript Standard Code Style. Read the rules here.
Copyright 2012-2015, JP Richardson [email protected]
MIT