Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/JtPublic

Extremely Small, Fast, and damn Customizable ⚙ template engine on Native low-level implementation. / Mr. Jt / [ TypeScript & JavaScript ]

License

NotificationsYou must be signed in to change notification settings

3F/Jt

Repository files navigation

Mr. Jt

🎩

Meet beardless customizable template engine, Mr. Jt for Node.js and Web browsers.

Build statusCoverage StatusTestsrelease-srcnpmLicenseCDN

Build history

jt.use('',' $Hello %p% {{world}} ').as({p:'amazing'}).reset().as({p:'crazy'})// ... +$Hello, +{{world}}
jt.use('s1','Today is a {( a < b )} good {/} bad {;} day!').sa(jtif,{a:5,b:7}).value()

Why Jt ?

Extremely small, fast, and damn customizable. Okay, Let's see what's going on:

Speed 🚀

Onlynative lower-level implementation. Even for conditional statements, like:

{( d > 5 )} yes {/} no {;}

Which donot usesregex, oreval(), ornew Function(), ... Feel the speed.

Size 📦

Extra small size. Just about o-n-e kilobyte of fully workable core engine:

  • ~1.02 KB for Core of ES6 gzipped;
  • ~ 1.09 KB for Core ofES3 gzipped;

Same things for custom handlers.

Configurable 🔧

You can configure, add, or change anything!

Jt was designed to be loyal to your preferenceson the fly. Maybe for this:

jt.use('s1','Good {{p}}, $p -p- !').as({p:'Jt'}).as({p:'Mr.'},{op:'$'}).as({p:'morning'},'{{}}').val(),

Or for this:

// {( true )} yes {/} no {;} -> {if( true )} yes {else} no {endif}jt.use('legacy','{if( true )} yes {else} no {endif}!').sa(newJtIfHandler(['{}'],{if:'if',else:'else',fi:'endif',})).val()// yes !

Or for something more ...

Extensible via Pluginable handlers 🗃

Sure! Add or change any features for the layers, stillon the fly.

Do you need something special? No problem, just implementIJtHandler to cover your awesome things. It easy.

Comfy but strong 🌇

Changeable layers through common chain will make you happy.

You can control everything just in a few steps:

jt.use('hello','Hello you from $tip, dear $name.').as({tip:'Jt',name:'John'});// Hello you from Jt, dear John.// ...jt.use('hello').as(-1,true).as({name:'Denis'})// Hello you from Jt, dear Denis..reset().as({tip:'Moscow'}).eject((v)=>t.is(v,'Hello you from Moscow, dear $name.'))....as({name:'{( r > 100 )}friend{/}visitor{;}'}).sa(jtif,{r:actual})// // Hello you from Moscow, dear friend.....val();🐧

Stability 🗠

CleanAPI and itstests will take care of your peace of mind.Coverage StatusTests

No dependencies to something 👐

Developed from scratch without dependencies to something from our end-product.

Open and Free 🍰

Open Source project; MIT License, Yes! Enjoy!

License

Licensed under theMIT License (MIT)

Copyright (c) 2019  Denis Kuzmin < entry.reg@gmail.com > GitHub/3F

[ ☕ Donate ]

API

Download

Separate ES3+/ES6+ support for your environment. Choose more suitable package for your case.

Build & Tests

npm installgulp build --conf debug

Available tests can be raised by command:

npm test

We're waiting for your awesome contributions!

About

Extremely Small, Fast, and damn Customizable ⚙ template engine on Native low-level implementation. / Mr. Jt / [ TypeScript & JavaScript ]

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp