beeline-nodejs
qubyte-codes
beeline-nodejs | qubyte-codes | |
---|---|---|
2 | 3 | |
53 | 9 | |
- | - | |
6.5 | 9.8 | |
9 days ago | 3 days ago | |
JavaScript | JavaScript | |
Apache License 2.0 | GNU Affero General Public License v3.0 |
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.
beeline-nodejs
-
Using ES Modules (ESM) in Node.js: A Practical Guide (Part 1)
I find using ES Modules in Node.js to be full of gotchas and anti-patterns - sticking with CommonJS seems more functional in most cases.
1: With ES Modules, imports are asynchronous.
Synchronous imports are incredibly powerful. You can ensure that your application doesn't block on first requests, but instead on load. Initializing connection pools, setting up caches, etc.
You'll also find quite a few packages in NPM that explicitly depend on require over import just so that they can perform the bindings they have to before things get going (see https://www.npmjs.com/package/honeycomb-beeline as an example).
2: With ES Modules imports are commonly destructured.
I know it makes your code feel lighter to have const { add } = import("whatever"); - but as your files grow larger, and those imports start to become complicated bits for middleware or other features, you're just making it more difficult for future maintainers to figure out what those functions mean. A bit of context never hurt anybody, and for my money I'll be that this:
app.use(check);
is not nearly as useful as
app.use(Validator.check);
The example may be contrived - but 9/10 times I find this makes code better than the alternative.
All of these arguments go out the door for Frontend work - that's a totally different terrain. I think one of the big arguments is that developers want to use the exact same JavaScript on frontend and Node applications - but that's an argument unwilling to admit the fact that they're two very different tasks. :)
-
A shallow dive into auto-instrumenting Node.js applications with Elastic APM
An even better option is auto-instrumentation, where the APM library automatically identifies the libraries you use and track the operations you do with them. This is how Elastic APM works. Honeycomb's Beeline, DataDog's dd-trace and the OpenTelemetry Node.js client also provide automatic instrumentation. Of course, "operations" don't only happen when you interact with other libraries, so these libraries still let you manually add spans.
qubyte-codes
-
Ask HN: Share Your Personal Site
https://qubyte.codes
I blog about things which interest me (mostly JS and creative code related), but also take Japanese language notes as I learn. Also part of the 250KB club!
It's built with my own hand-rolled static site generator, and I'm pretty proud of it's capabilities now. I've got a bunch of indieweb features integrated into it. I have no sense of style though!
Source: https://github.com/qubyte/qubyte-codes
-
Math Rendering Is Wrong
I use server rendered SVG with mathjax as part of my static site generator. To try to make it as accessible as possible I add a title element with an ID to each SVG and use an aria-labelledby attribute to connect the two [1] (a sample for the interested, scroll about half way down [2]). The title content is the unrendered LaTeX source.
I'm very interested in the notion of using HTML and CSS rendering though! Many thanks to the author for pointing out this functionality.
[1]: https://github.com/qubyte/qubyte-codes/blob/main/lib/render....
-
Using ES Modules (ESM) in Node.js: A Practical Guide (Part 1)
Another static site builder author here. I found some of the same awkwardness in recreating __dirname, but after some massaging found it only remains when path.join is also used (which can't work with a file URL and can't be simply replaced with URL construction because the existing path is lost). I went the whole hog and completely replaced all CJS in my own code, and it's working well. Luckily I avoided issues with third party modules breaking.
PR with the changes: https://github.com/qubyte/qubyte-codes/pull/323
What are some alternatives?
TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
top-bun - 🍞 Flour Water Salt Yeast HTML CSS JS
apm-agent-nodejs - Elastic APM Node.js Agent
slightknack.dev - Source code for my website/blog. Custom Zola theme over GH Pages.
zipkin-js - Zipkin instrumentation for Node.js and browsers
2022-portfolio
require-in-the-middle - Module to hook into the Node.js require function
xenodium - Config files for my GitHub profile.
kloi - kloi is a tiny toolkit for building simple static sites.
ethanmick.com - Personal website, portfolio, and teaching area to help anyone become a better software engineer.
latex2mathml - Pure Python library for LaTeX to MathML conversion
react-simple-terminal - A very simplistic react terminal