dax
awesome-tagged-templates
dax | awesome-tagged-templates | |
---|---|---|
4 | 27 | |
927 | 92 | |
- | - | |
8.6 | 10.0 | |
7 days ago | about 3 years ago | |
TypeScript | ||
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
dax
-
Bun 1.1
> Also with Deno, it become very easy to write typed cli. .ts file can be run as script very easily with permission access defined on top of the script such as:
I do this all the time. I used to use npx in my hashbang line to run TS scripts with node, but I've started using Deno more because of the permissions. Another great package for shell scripting with Deno is Dax, which is like the Deno version of Bun shell: https://github.com/dsherret/dax
> Also project such as https://cliffy.io has made writing cli way more enjoyable than node.
This looks cool. I've always used the npm package inquirer (which also works with Deno), but I'll have to compare cliffy to that and see how it stacks up.
> Hono (projects conform to modern web standard, and is runtime agnostic for JS)
Hono is awesome. It's fast, very well typed, runs on all JS runtimes, and has zero dependencies.
-
The Bun Shell
Great point! According to https://github.com/oven-sh/bun/blob/b433beb016470b87850f3c01..., Bun Shell took inspiration from zx[0], dax[1] and bnx[2]
[0]: https://github.com/google/zx
[1]: https://github.com/dsherret/dax
[2]: https://github.com/wobsoriano/bnx
-
Create scripts in JavaScript with zx
Found a good alternative for deno: https://github.com/dsherret/dax
awesome-tagged-templates
-
How and why do we bundle zx?
When zx first appeared, it was a tiny esm script that just proposed a new idea for how child_process.spawn API could be enhanced with string template literals.
-
Building a Dynamic Client-Side Blog with Secutio & Bootstrap
The template combines HTML and JavaScript. To understand this approach, consider how PHP pages are generated. In PHP, code is embedded within the HTML. Similarly, this library leverages JavaScript template literals to achieve the same objective. From the definition: "Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded expressions, and special constructs called tagged templates".
-
Number and Currency Formatting in JavaScript using Intl.NumberFormat
The numbers we are printing are monetary values so they are missing a decimal value and a currency symbol. One way we can do this is by using JavaScript template literals to append and prepend the pieces we are missing.
-
Bun 1.1
Tagged templates[0], the language feature that enables this, were introduced in ECMAScript 2015 apparently – arguably at least somewhat new in the lifespan of JavaScript. :)
Java is getting a similar feature with template processors[1]. It would be nice to have it in Python as well – i.e. not just f-strings, but something that (like tagged templates) allows a template function process the interpolated values to properly encode them for whatever language is appropriate (e.g. shell, SQL, HTML, etc.).
[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
[1] https://openjdk.org/jeps/459
-
JavaScript Template Literals
References: Template literals (Template strings)
-
A React Developers Guide to Writing Enhance Components
We are using a string template literal to create the tag and the ${} syntax to provide string interpolation, that is, substituting the values of href and altText into our string.
-
TypeScript Template Literal Types: Practical Use-Cases for Improved Code Quality
In TypeScript, a string literal type is a type that represents a specific set of string values. For example, the type "red" | "green" | "blue" represents the set of three string values "red", "green", and "blue". Template literal types allow you to perform operations on these string literal types using the same syntax as template literal strings in JavaScript.
-
Exploring Secutio Task by Task. Setting "Events" Like Stylesheets!
The example also showcases the use of inline templates, employing JavaScript Template Literals. The JSON data obtained from the GET request is accessible through the "data" variable.
-
The Bun Shell
These are called "tagged templates": https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- AI for Web Devs: Your First API Request to OpenAI
What are some alternatives?
cinnamon - A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
rewrite-styled-components - Rewrite library styled-components in ~ 60 line code
exa-kernel - EXA Kernel
dom-examples - Code examples that accompany various MDN DOM and Web API documentation pages
bnx - zx inspired shell for Bun.
enhance-starter-project - file based routing metaframework for blazing fast custom elements
enhance.dev - Docs website for Enhance!
gptcli - ChatGPT in command line with OpenAI API (gpt-3.5-turbo/gpt-4/gpt-4-32k)