JavaScript / JS snippets for your Sublime Text 2 Fu.
Install via package control: http://wbond.net/sublime_packages/community Search for JavaScript Snippets or typically the keywords js or javascript are suitable.
git clone git://github.com/jprichardson/sublime-js-snippets.git ~/Library/Application Support/Sublime Text 2/Packages/JavaScript
git clone git://github.com/jprichardson/sublime-js-snippets.git ~/.config/sublime-text-2/Packages/JavaScript
git clone git://github.com/jprichardson/sublime-js-snippets.git %userprofile%\AppData\Roaming\Sublime Text 2\Packages\JavaScript
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...}
})
JP Richardson
Copyright 2012, JP Richardson jprichardson@gmail.com
MIT