222 private links
The way to bundle JS projects 😃
How to structure a website that is not built with an SPA style?
const
only ensures that the reference is not modified. The data referenced can be modified though.
Also, primitive data types are immutable. So a const a = 5
can not be updated as 5 as Number can not change.
When we use const, we create an indestructible link between a variable name and a piece of data. We're still allowed to modify the data itself though!
How to create a web worker?
- Create a script that imports another one with
const worker = new Worker('worker.js'
- Bind events emitted by the worker with
worker.onmessage = function(event) { ... }
- Do the same in the web worker with
self.onmessage = function(event) { ... }
- Exchange messages with
worker.postMessage(payload)
orself.postMessage(payload)
One key difference between Web Workers and the main thread is that Web Workers have no access to the DOM or the UI. This means that they cannot directly manipulate the HTML elements on the page or interact with the user.
Get the event information of a keydown event :)
A library to handle right and permissions.
It is very useful if both backend and frontend are written in JS.
A package.json can be provided in order to scan dependencies. It searches for risks.
Checks how vulnerable is a package.
It provides informations to asses if a package is safe enough for the use case.
The tool provides analysis for each line of code too.
A framework to build web components where targets can also be other web frameworks.
A great project to get started with hexagons (for example, a map).
Using POO can help to structure the application code with the d3 library.
publint lints npm packages for packaging errors, ensuring maximum compatibility across environments. This means that consumers of your package can safely run your code in any platform, e.g. Vite, Webpack, Rollup, Node.js, etc.
A great example!
Vérifier la validité des liens d'une page et y ajouter une classe .status comme .status404
js/ts utils
The technologies that are gaining popularity. It is based on github stars.
A lot of so useful projects for web development!
Check them here: https://unjs.io/
Benchmarking javascript snippets :)