ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Java​Script Snippets

by jprichardson ALL

Snippets for JavaScript / JS Programming in Sublime Text 2 & 3

Labels snippets

Details

  • 2017.07.14.19.15.43
  • github.​com
  • github.​com
  • 8 years ago
  • 11 hours ago
  • 12 years ago

Installs

  • Total 207K
  • Win 138K
  • Mac 40K
  • Linux 30K
Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13
Windows 1 0 2 1 1 5 5 2 0 3 1 2 2 3 1 2 2 1 3 5 3 2 2 2 0 1 2 2 2 1 1 5 1 2 1 2 1 0 5 2 1 2 3 1 0 3
Mac 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 1 0 1
Linux 0 0 0 0 1 0 2 0 0 0 1 0 2 0 0 0 0 2 0 0 0 0 0 1 1 0 1 1 1 0 0 0 1 1 0 2 0 1 1 1 0 1 0 0 2 1
02468Mar 30Mar 27Mar 24Mar 21Mar 18Mar 15Mar 12Mar 9Mar 6Mar 3Feb 28Feb 25Feb 22Feb 19Feb 16Feb 13Mar 30 Linux: 0 Mac: 0 Windows: 1Mar 29 Linux: 0 Mac: 0 Windows: 0Mar 28 Linux: 0 Mac: 0 Windows: 2Mar 27 Linux: 0 Mac: 0 Windows: 1Mar 26 Linux: 1 Mac: 0 Windows: 1Mar 25 Linux: 0 Mac: 1 Windows: 5Mar 24 Linux: 2 Mac: 1 Windows: 5Mar 23 Linux: 0 Mac: 0 Windows: 2Mar 22 Linux: 0 Mac: 0 Windows: 0Mar 21 Linux: 0 Mac: 0 Windows: 3Mar 20 Linux: 1 Mac: 0 Windows: 1Mar 19 Linux: 0 Mac: 0 Windows: 2Mar 18 Linux: 2 Mac: 0 Windows: 2Mar 17 Linux: 0 Mac: 0 Windows: 3Mar 16 Linux: 0 Mac: 0 Windows: 1Mar 15 Linux: 0 Mac: 0 Windows: 2Mar 14 Linux: 0 Mac: 0 Windows: 2Mar 13 Linux: 2 Mac: 0 Windows: 1Mar 12 Linux: 0 Mac: 0 Windows: 3Mar 11 Linux: 0 Mac: 0 Windows: 5Mar 10 Linux: 0 Mac: 0 Windows: 3Mar 9 Linux: 0 Mac: 0 Windows: 2Mar 8 Linux: 0 Mac: 0 Windows: 2Mar 7 Linux: 1 Mac: 1 Windows: 2Mar 6 Linux: 1 Mac: 0 Windows: 0Mar 5 Linux: 0 Mac: 0 Windows: 1Mar 4 Linux: 1 Mac: 0 Windows: 2Mar 3 Linux: 1 Mac: 0 Windows: 2Mar 2 Linux: 1 Mac: 0 Windows: 2Mar 1 Linux: 0 Mac: 1 Windows: 1Feb 28 Linux: 0 Mac: 0 Windows: 1Feb 27 Linux: 0 Mac: 1 Windows: 5Feb 26 Linux: 1 Mac: 0 Windows: 1Feb 25 Linux: 1 Mac: 1 Windows: 2Feb 24 Linux: 0 Mac: 0 Windows: 1Feb 23 Linux: 2 Mac: 0 Windows: 2Feb 22 Linux: 0 Mac: 0 Windows: 1Feb 21 Linux: 1 Mac: 0 Windows: 0Feb 20 Linux: 1 Mac: 0 Windows: 5Feb 19 Linux: 1 Mac: 0 Windows: 2Feb 18 Linux: 0 Mac: 0 Windows: 1Feb 17 Linux: 1 Mac: 0 Windows: 2Feb 16 Linux: 0 Mac: 1 Windows: 3Feb 15 Linux: 0 Mac: 1 Windows: 1Feb 14 Linux: 2 Mac: 0 Windows: 0Feb 13 Linux: 1 Mac: 1 Windows: 3Mar 30 Linux: 0 Mac: 0 Windows: 1Mar 29 Linux: 0 Mac: 0 Windows: 0Mar 28 Linux: 0 Mac: 0 Windows: 2Mar 27 Linux: 0 Mac: 0 Windows: 1Mar 26 Linux: 1 Mac: 0 Windows: 1Mar 25 Linux: 0 Mac: 1 Windows: 5Mar 24 Linux: 2 Mac: 1 Windows: 5Mar 23 Linux: 0 Mac: 0 Windows: 2Mar 22 Linux: 0 Mac: 0 Windows: 0Mar 21 Linux: 0 Mac: 0 Windows: 3Mar 20 Linux: 1 Mac: 0 Windows: 1Mar 19 Linux: 0 Mac: 0 Windows: 2Mar 18 Linux: 2 Mac: 0 Windows: 2Mar 17 Linux: 0 Mac: 0 Windows: 3Mar 16 Linux: 0 Mac: 0 Windows: 1Mar 15 Linux: 0 Mac: 0 Windows: 2Mar 14 Linux: 0 Mac: 0 Windows: 2Mar 13 Linux: 2 Mac: 0 Windows: 1Mar 12 Linux: 0 Mac: 0 Windows: 3Mar 11 Linux: 0 Mac: 0 Windows: 5Mar 10 Linux: 0 Mac: 0 Windows: 3Mar 9 Linux: 0 Mac: 0 Windows: 2Mar 8 Linux: 0 Mac: 0 Windows: 2Mar 7 Linux: 1 Mac: 1 Windows: 2Mar 6 Linux: 1 Mac: 0 Windows: 0Mar 5 Linux: 0 Mac: 0 Windows: 1Mar 4 Linux: 1 Mac: 0 Windows: 2Mar 3 Linux: 1 Mac: 0 Windows: 2Mar 2 Linux: 1 Mac: 0 Windows: 2Mar 1 Linux: 0 Mac: 1 Windows: 1Feb 28 Linux: 0 Mac: 0 Windows: 1Feb 27 Linux: 0 Mac: 1 Windows: 5Feb 26 Linux: 1 Mac: 0 Windows: 1Feb 25 Linux: 1 Mac: 1 Windows: 2Feb 24 Linux: 0 Mac: 0 Windows: 1Feb 23 Linux: 2 Mac: 0 Windows: 2Feb 22 Linux: 0 Mac: 0 Windows: 1Feb 21 Linux: 1 Mac: 0 Windows: 0Feb 20 Linux: 1 Mac: 0 Windows: 5Feb 19 Linux: 1 Mac: 0 Windows: 2Feb 18 Linux: 0 Mac: 0 Windows: 1Feb 17 Linux: 1 Mac: 0 Windows: 2Feb 16 Linux: 0 Mac: 1 Windows: 3Feb 15 Linux: 0 Mac: 1 Windows: 1Feb 14 Linux: 2 Mac: 0 Windows: 0Feb 13 Linux: 1 Mac: 1 Windows: 3Mar 30 Linux: 0 Mac: 0 Windows: 1Mar 29 Linux: 0 Mac: 0 Windows: 0Mar 28 Linux: 0 Mac: 0 Windows: 2Mar 27 Linux: 0 Mac: 0 Windows: 1Mar 26 Linux: 1 Mac: 0 Windows: 1Mar 25 Linux: 0 Mac: 1 Windows: 5Mar 24 Linux: 2 Mac: 1 Windows: 5Mar 23 Linux: 0 Mac: 0 Windows: 2Mar 22 Linux: 0 Mac: 0 Windows: 0Mar 21 Linux: 0 Mac: 0 Windows: 3Mar 20 Linux: 1 Mac: 0 Windows: 1Mar 19 Linux: 0 Mac: 0 Windows: 2Mar 18 Linux: 2 Mac: 0 Windows: 2Mar 17 Linux: 0 Mac: 0 Windows: 3Mar 16 Linux: 0 Mac: 0 Windows: 1Mar 15 Linux: 0 Mac: 0 Windows: 2Mar 14 Linux: 0 Mac: 0 Windows: 2Mar 13 Linux: 2 Mac: 0 Windows: 1Mar 12 Linux: 0 Mac: 0 Windows: 3Mar 11 Linux: 0 Mac: 0 Windows: 5Mar 10 Linux: 0 Mac: 0 Windows: 3Mar 9 Linux: 0 Mac: 0 Windows: 2Mar 8 Linux: 0 Mac: 0 Windows: 2Mar 7 Linux: 1 Mac: 1 Windows: 2Mar 6 Linux: 1 Mac: 0 Windows: 0Mar 5 Linux: 0 Mac: 0 Windows: 1Mar 4 Linux: 1 Mac: 0 Windows: 2Mar 3 Linux: 1 Mac: 0 Windows: 2Mar 2 Linux: 1 Mac: 0 Windows: 2Mar 1 Linux: 0 Mac: 1 Windows: 1Feb 28 Linux: 0 Mac: 0 Windows: 1Feb 27 Linux: 0 Mac: 1 Windows: 5Feb 26 Linux: 1 Mac: 0 Windows: 1Feb 25 Linux: 1 Mac: 1 Windows: 2Feb 24 Linux: 0 Mac: 0 Windows: 1Feb 23 Linux: 2 Mac: 0 Windows: 2Feb 22 Linux: 0 Mac: 0 Windows: 1Feb 21 Linux: 1 Mac: 0 Windows: 0Feb 20 Linux: 1 Mac: 0 Windows: 5Feb 19 Linux: 1 Mac: 0 Windows: 2Feb 18 Linux: 0 Mac: 0 Windows: 1Feb 17 Linux: 1 Mac: 0 Windows: 2Feb 16 Linux: 0 Mac: 1 Windows: 3Feb 15 Linux: 0 Mac: 1 Windows: 1Feb 14 Linux: 2 Mac: 0 Windows: 0Feb 13 Linux: 1 Mac: 1 Windows: 3

Readme

Source
raw.​githubusercontent.​com

Sublime Text Editor 2 / 3 - JavaScript Snippets

JavaScript / JS snippets for your Sublime Text 2 / 3 Fu.

Install

Sublime Text 2 / 3 - Package Control

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.

Vanilla Snippets

[afn] anonymous function

function (${1:arguments}) {
    ${0:// body...}
}

[cd] console.dir

console.dir(${1:obj})${0}

[ce] console.error

console.error(${1:error})${0}

[ci] console.info

console.info(${1:msg})${0}

[cl] console.log

console.log(${1:msg})${0}

[cli] console.log with util.inspect

console.log(require('util').inspect(${1:obj}, true, ${2:10}, true))${0}

[ct] console.trace

console.trace(${1:msg})${0}

[cw] console.warn

console.warn(${1:msg})${0}

[fn] function

function ${1:methodName} (${2:arguments}) {
    ${0:// body...}
}

[ii] Immediately-invoked function expression

(function () {
    ${0:// body...}
})();

[me] module.exports

module.exports = ${1}

[okfe] Objects.keys and forEach

Object.keys(${1:obj}).forEach(function (key) {
    ${0:// body...}
})

[pe] process.exit

process.exit()

[proto] prototype

${1:ClassName}.prototype.${2:methodName} = function (${3:arguments}) {
    ${0:// body...}
}

[req] require

require('${1:package}')${0}

[sto] setTimeout

setTimeout(function () {
    ${2:// body...}
}, ${1:millis})

[sti] setInterval

setInterval(function () {
    ${2:// body...}
}, ${1:millis})

[us] use strict

'use strict'

Behaviorial Driven Development

[desc] describe

describe('${1:description}', function () {
    ${0:// body...}
})

[ita] asychronous it

it('${1:description}', function (done) {
    ${0:// body...}
})

[its] synchronous it

it('${1:description}', function () {
    ${0:// body...}
})

JavaScript Style

js-standard-style

Uses JavaScript Standard Code Style. Read the rules here.

License

Copyright 2012-2015, JP Richardson jprichardson@gmail.com

MIT