{"id":15365770,"url":"https://github.com/tunnckocore/javascript-charlike-snippets","last_synced_at":"2025-04-14T07:51:36.125Z","repository":{"id":29152202,"uuid":"32682454","full_name":"tunnckoCore/javascript-charlike-snippets","owner":"tunnckoCore","description":"My SublimeText 3 snippets. From BDD through `assert` to singleton pattern, es6 fat arrows and es6 import","archived":false,"fork":false,"pushed_at":"2016-02-27T23:44:24.000Z","size":92968,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T12:43:37.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://j.mp/1KP6v1y","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tunnckoCore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-22T15:51:01.000Z","updated_at":"2019-07-16T07:45:18.000Z","dependencies_parsed_at":"2022-09-06T13:01:20.321Z","dependency_job_id":null,"html_url":"https://github.com/tunnckoCore/javascript-charlike-snippets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fjavascript-charlike-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fjavascript-charlike-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fjavascript-charlike-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fjavascript-charlike-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tunnckoCore","download_url":"https://codeload.github.com/tunnckoCore/javascript-charlike-snippets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248844075,"owners_count":21170486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T13:15:59.407Z","updated_at":"2025-04-14T07:51:36.097Z","avatar_url":"https://github.com/tunnckoCore.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## javascript-charlike-snippets\n\n\u003e My SublimeText 2/3 snippets. From BDD through `assert` to singleton pattern, es6 fat arrows and es6 import\n\n\n## Rebuilding\n```\nzip javascript-charlike-snippets.sublime-package -r javascript-charlike-snippets \u0026\u0026 cp javascript-charlike-snippets.sublime-package ~/.config/sublime-text-3/Installed\\ Packages/\n```\n\n\n## Code Style\n\n[![standard][standard-image]][standard-url]\n\nThis snippets use [`standard`][standard-url] to maintain code style and consistency, and to avoid style arguments. You are encouraged to install it globally.\n\n[standard-image]: https://cdn.rawgit.com/feross/standard/master/badge.svg\n[standard-url]: https://github.com/feross/standard\n\n\n## Table of Contents\n- [module system](#module-system)\n  + `rr` node variable require\n  + `req` node require\n  + `imp` javascript import\n- [functions-and-arrows](#functions-and-arrows)\n  + `fat` es6 arrow function\n  + `ofat` es6 arrow function as object property\n  + `me` module.exports\n  + `men` module.exports - named function\n  + `mea` module.exports - anonymous function\n  + `fn` named function\n  + `afn` anonymous function\n  + `ofn` named function as object property\n  + `oafn` anonymous function as object property\n  + `fixture` fixture function (useful when assert.throws)\n  + `iife` immediately-invoked function expression\n- [assert](#assert)\n  + `ase` assert.equal\n  + `asn` assert.notEqual\n  + `asse` assert.strictEqual\n  + `assn` assert.notStrictEqual\n  + `asd` assert.deepEqual\n  + `asdn` assert.notDeepEqual\n  + `assd` assert.deepStrictEqual\n  + `assdn` assert.notDeepStrictEqual\n  + `asi` assert.ifError\n  + `ast` assert.throws(actual, expected, msg)\n  + `aste` assert.throws fixture Error\n  + `asttype`  assert.throws fixture TypeError\n  + `astre`  assert.throws fixture regexp message\n- [testing](#testing)\n  + `desc` describe\n  + `ita` it async\n  + `its` it sync\n- [console and misc](#console-and-misc)\n  + `cl` console.log\n  + `ce` console.error\n  + `self` self this\n  + `us` use strict\n  + `loop` fast while loop\n  + `singleton` singleton pattern\n  + `var` variable assigning, e.g. `var foo = bar`\n  + `iftypeof` if block with typeof check\n  + `iferr` if block with typeof check and throw TypeError\n  + `typeof` typeof check with strict equality\n  + `thr` throw error\n  + `thn` throw error with new\n\n\n### module system\n\n- **[rr]** node variable require\n\n```js\nvar ${2:pkg} = require('${1:package}')${0}\n```\n\n- **[req]** node require\n\n```js\nrequire('${1:package}')${0}\n```\n\n- **[imp]** javascript import\n\n```js\nimport ${2:pkg} from '${1:package}'${0}\n```\n\n### functions and arrows\n\n- **[fat]** es6 arrow\n\n```js\n(${1:args}) =\u003e ${0}\n```\n\n- **[ofat]** es6 arrow as object property\n\n```js\n${1:name}: (${2:args}) =\u003e ${0}\n```\n\n- **[me]** module.exports\n\n```js\nmodule.exports = ${0}\n```\n\n- **[men]** module.exports - named function\n\n```js\nmodule.exports = function ${1:name} (${2:args}) {\n  ${0}\n}\n```\n\n- **[mea]** module.exports - anonymous function\n\n```js\nmodule.exports = function (${2:args}) {\n  ${0}\n}\n```\n\n- **[fn]** named function\n\n```js\nfunction ${1:name} (${2:args}) {\n  ${0}\n}\n```\n\n- **[afn]** anonymous function\n\n```js\nfunction (${1:args}) {\n  ${0}\n}\n```\n\n- **[ofn]** named function as object property\n\n\n```js\n${1:name}: function ${1:name} (${2:args}) {\n  ${0}\n}\n```\n\n- **[oafn]** anonymous function as object property\n\n```js\n${1:name}: function (${2:args}) {\n  ${0}\n}\n```\n\n- **[fixture]** fixture function (useful when assert.throws)\n\n```js\nfunction fixture () {\n  ${1:fnName}\n}${0}\n```\n\n### assert\n\n- **[ase]** assert equal\n\n```js\n${1:assert}.equal(${2:actual}, ${3:expected}, ${4:msg})${0}\n```\n\n- **[asn]** assert notEqual\n\n```js\n${1:assert}.notEqual(${2:actual}, ${3:expected}, ${4:msg})${0}\n```\n\n- **[asse]** assert strictEqual\n\n```js\n${1:assert}.strictEqual(${2:actual}, ${3:expected}, ${4:msg})${0}\n```\n\n- **[assn]** assert notStrictEqual\n\n```js\n${1:assert}.notStrictEqual(${2:actual}, ${3:expected}, ${4:msg})${0}\n```\n\n- **[asd]** assert deepEqual\n\n```js\n${1:assert}.deepEqual(${2:actual}, ${3:expected}, ${4:msg})${0}\n```\n\n- **[asdn]** assert notDeepEqual\n\n```js\n${1:assert}.notDeepEqual(${2:actual}, ${3:expected}, ${4:msg})${0}\n```\n\n- **[assd]** assert.deepStrictEqual\n\n```js\n${1:assert}.deepStrictEqual(${2:actual}, ${3:expected}, ${4:msg})${0}\n```\n\n- **[assdn]** assert.notDeepStrictEqual\n\n```js\n${1:assert}.notDeepStrictEqual(${2:actual}, ${3:expected}, ${4:msg})${0}\n```\n\n- **[asi]** assert.ifError\n\n```js\n${1:assert}.ifError(${2:err})${0}\n```\n\n- **[ast]** assert.throws\n\n```js\n${1:assert}.throws(${2:actual}, ${3:expected}, ${4:msg})${0}\n```\n\n- **[aste]** assert.throws fixture Error\n\n```js\n${1:assert}.throws(${2:fixture}, Error)${0}\n```\n\n- **[asttype]** assert.throws fixture TypeError\n\n```js\n${1:assert}.throws(${2:fixture}, TypeError)${0}\n```\n\n- **[astre]** assert.throws fixture regexp message\n\n```js\n${1:assert}.throws(${2:fixture}, /${3:expected msg}/)${0}\n```\n\n### testing\n\n- **[desc]** describe\n\n```js\n${1:describe}('${2:description}', function () {\n  ${0}\n})\n```\n\n- **[ita]** it async\n\n```js\n${1:it}('${2:description}', function (${3:done}) {\n  ${0}\n  ${4:done}()\n})\n```\n\n- **[its]** it sync\n\n```js\n${1:it}('${2:description}', function () {\n  ${0}\n})\n```\n\n### console and misc\n\n- **[cl]** console.log\n\n```js\nconsole.log(${1:actual})${0}\n```\n\n- **[ce]** console.error\n\n```js\nconsole.error(${1:actual})${0}\n```\n\n- **[self]** self this\n\n```js\nvar self = this\n```\n\n- **[us]** use strict\n\n```js\n'use strict'\n```\n\n- **[loop]** fast while loop\n\n```js\nvar len = ${1:arr}.length\nvar i = 0\n\nwhile (i \u003c len) {\n  var val = ${1:arr}[${2:i++}]\n  ${0}\n}\n```\n\n- **[singleton]** singleton pattern\n\n```js\nfunction ${1:ClassName} (${2:options}) {\n  if (!(this instanceof ${1:ClassName})) {\n    return new ${1:ClassName}(${2:options})\n  }\n  ${0}\n}\n```\n\n- **[var]** variable assigning\n\n```js\nvar ${2:foo} = ${1:bar}${0}\n```\n\n- **[iftypeof]** if block with typeof check\n\n```js\nif (typeof ${1:actual} === ${2:expected}) {\n  ${0}\n}\n```\n\n- **[iferr]** if block with typeof check and throw TypeError\n\n```js\nif (typeof ${1:actual} === ${2:expected}) {\n  throw new ${3:TypeError}('${4:message}')\n}${0}\n```\n\n\n- **[typeof]** typeof check with strict equality\n\n```js\ntypeof ${1:actual} === ${2:expected}\n```\n\n- **[thr]** throw error\n\n```js\nthrow ${1:err}\n```\n\n- **[thn]** throw error with new\n\n```js\nthrow new ${1:TypeError}('${2:message}')${0}\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/always-callback/issues/new).  \nBut before doing anything, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines.\n\n\n## [Charlike Make Reagent](http://j.mp/1stW47C) [![new message to charlike][new-message-img]][new-message-url] [![freenode #charlike][freenode-img]][freenode-url]\n\n[![tunnckocore.tk][author-www-img]][author-www-url] [![keybase tunnckocore][keybase-img]][keybase-url] [![tunnckoCore npm][author-npm-img]][author-npm-url] [![tunnckoCore twitter][author-twitter-img]][author-twitter-url] [![tunnckoCore github][author-github-img]][author-github-url]\n\n\n[author-www-url]: http://www.tunnckocore.tk\n[author-www-img]: https://img.shields.io/badge/www-tunnckocore.tk-fe7d37.svg\n\n[keybase-url]: https://keybase.io/tunnckocore\n[keybase-img]: https://img.shields.io/badge/keybase-tunnckocore-8a7967.svg\n\n[author-npm-url]: https://www.npmjs.com/~tunnckocore\n[author-npm-img]: https://img.shields.io/badge/npm-~tunnckocore-cb3837.svg\n\n[author-twitter-url]: https://twitter.com/tunnckoCore\n[author-twitter-img]: https://img.shields.io/badge/twitter-@tunnckoCore-55acee.svg\n\n[author-github-url]: https://github.com/tunnckoCore\n[author-github-img]: https://img.shields.io/badge/github-@tunnckoCore-4183c4.svg\n\n[freenode-url]: http://webchat.freenode.net/?channels=charlike\n[freenode-img]: https://img.shields.io/badge/freenode-%23charlike-5654a4.svg\n\n[new-message-url]: https://github.com/tunnckoCore/messages\n[new-message-img]: https://img.shields.io/badge/send%20me-message-green.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fjavascript-charlike-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftunnckocore%2Fjavascript-charlike-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fjavascript-charlike-snippets/lists"}