atom-turbo-javascript开源项目

我要开发同款
匿名用户2021年12月23日
47阅读
开发技术JavaScript
所属分类Atom插件、插件和扩展、Atom 插件
授权协议MIT License

作品详情

turbo-javascript

AcollectionofcommandsandES6-readysnippetsforoptimizingJavascriptandTypescriptdevelopmentproductivity.

Commands

Usethefollowingkeymapstospeedupyourdevelopment.Youcanquicklyterminatelineswithsemicolonsormanipulateblocksofcodewithease.

EndLineCTRL-;

Terminatesthecurrentlinewithasemicolon.

EndLinewithacommaCTRL-,

Terminatesthecurrentlinewithacomma(greatforobjectliterals).

EndNewLineCTRL-ENTER

Terminatesthecurrentlinewithacolonorsemicolon,followedwithanewline.Acommaisinsertedwhenthecursorisinsideanobjectliteral,otherwiseasemicolonisinserted.

EasyBlocksCTRL-B

Createsastatementblock{...}withtheselectedtextplacedinsideandproperlyindented.Iftheselectionisalreadywrappedwithablock,theblockisremovedanditscontentisunindented.

Snippets

Snippetsareoptimizedtobeshortandeasytoremember.Somesnippetsare"chainable"andrenderdifferentlywhenprecededbya".".

Forexample,.ferendersachain-friendlyversionofthe"forEach"snippet,whileferendersafullcodeblock.

Declarationsv⇥varstatementvar${1:name}v=⇥varassignmentvar${1:name}=${2:value}l⇥letstatementlet${1:name}l=⇥letassignmentlet${1:name}=${2:value}co⇥conststatementconst${1:name}co=⇥constassignmentconst${1:name}=${2:value}FlowControlif⇥ifstatementif(${1:condition}){${0}}el⇥elsestatementelse{${0}}ife⇥elsestatementif(${1:condition}){${0}}else{}ei⇥elseifstatementelseif(${1:condition}){${0}}fl⇥forloopfor(let${1:i}=0,${2:len}=${3:iterable}.length;${1:i}<${2:len};${1:i}++){${0}}fi⇥forinloopfor(let${1:key}in${2:source}){if(${2:source}.hasOwnProperty(${1:key})){${0}}}fo⇥forofloop(ES6)for(let${1:key}of${2:source}){${0}}wl⇥whileloopwhile(${1:condition}){${0}}tc⇥try/catchtry{${0}}catch(${1:err}){}tf⇥try/finallytry{${0}}finally{}tcf⇥try/catch/finallytry{${0}}catch(${1:err}){}finally{}sw⇥switchcaseswitch(${1:expr}){case${2:value}:return$0;default:return;}Functionsf⇥anonymousfunctionfunction(${1:arguments}){${0}}fn⇥namedfunctionfunction${1:name}(${2:arguments}){${0}}iife⇥immediately-invokedfunctionexpression(IIFE)(function(${1:arguments}){${0}})(${2});fa⇥functionapply${1:fn}.apply(${2:this},${3:arguments})fc⇥functioncall${1:fn}.call(${2:this},${3:arguments})fb⇥functionbind${1:fn}.bind(${2:this},${3:arguments})af⇥arrowfunction(ES6)(${1:arguments})=>${2:statement}afb⇥arrowfunctionwithbody(ES6)(${1:arguments})=>{\t${0}}gf⇥generatorfunction(ES6)function*(${1:arguments}){${0}}gfn⇥namedgeneratorfunction(ES6)function*${1:name}(${1:arguments}){${0}}Iterablesseq⇥sequenceof0..n[...Array(${1:length}).keys()]${0}fe⇥forEachloop(chainable)${1:iterable}.forEach((${2:item})=>{${0}});map⇥mapfunction(chainable)${1:iterable}.map((${2:item})=>{${0}});reduce⇥reducefunction(chainable)${1:iterable}.reduce((${2:previous},${3:current})=>{${0}}${4:,initial});filter⇥filterfunction(chainable)${1:iterable}.filter((${2:item})=>{${0}});find⇥ES6findfunction(chainable)${1:iterable}.find((${2:item})=>{${0}});Objectsandclassesc⇥class(ES6)class${1:name}{constructor(${2:arguments}){${0}}}cex⇥childclass(ES6)class${1:name}extends${2:base}{constructor(${2:arguments}){super(${2:arguments});${0}}}ctorclassconstructor(ES6)constructor(${1:arguments}){super(${1:arguments});${0}}:⇥key/valuepair

Javascript:

${1:key}:${2:'value'}

JSON:

"${1:key}":${2:"value"}m⇥method(ES6syntax)${1:method}(${2:arguments}){${0}}get⇥getter(ES6syntax)get${1:property}(){${0}}
查看全文
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论