I signed up for the Ohio Vax-A-Million vaccine lottery at ohiovaxamillion.com, even though the site and domain registration seemed a little suspicious.
Continue reading post "#3417"WWW posts page 7
Stir Trek 2021
I watched the Stir Trek conference today, live streaming. It was done virtually this year due to the Covid situation.
Continue reading post "Stir Trek 2021"I found myself needing to get the path to the current script and its directory in a local Node JS script recently. In Common JS scripts, that is available by __filename
or __dirname
globals, but it isn’t available by the same means in ES modules. Instead, there is import.meta.url
, which can be used to get at the directory name if needed, like:
const __filename = import.meta.url.replace(/^file:[\/]+/, '/');
const __dirname = __filename.split('/').slice(0, -1).join('/');
JS: ES Modules and Node bare specifiers via response rewrite
I’ve been playing with JS lately, including ES modules and building with Rollup, Babel, and Terser, along with other accessories. One thing I’m disappointed with of ES modules in the Nodejs ecosystem is dealing with third party imports. Using the “bare” specifiers that Node expects works fine in that environment and thus tools running in it (possibly needing helpers), but they don’t work at all directly in the browser. This is discussed in this post by Jake Archibold, for instance.
Import maps are one solution in the works, but that requires explicitly mapping every dependency, which could get complicated fast when dependencies have dependencies. It also is only in draft stage and only works in Blink based browsers currently.
I eventually gave in to the idea of having server code rewrite the paths in the js file responses to point to a symlinked node_modules
folder, similar to what is mentioned in this post by the Polymer project. I created a PHP test server for one of my projects that does this.
The xmlrpc.php
file of my WordPress blog recently got hit by a single bot some 5000 times over a half hour period recently. I temporarily disabled all visitors and then limited it to just blocking the specific IP via Apache conf (htaccess).
I’ve signed up for the virtual Stir Trek this year.
Continue reading post "#3340"Dreamhost has added a nicer DNS management interface, along with some other updates to its panel.
Continue reading post "#3322"I bought a short domain name in part so I could have a short email address that was easy to share. Unfortunately, I’m finding it to sometimes confuse people or require more effort than expected to spell out.
Continue reading post "#3314"The installation of a new version of nodejs via MacPorts took nearly two hours.
Continue reading post "#3312"I guess npm doesn’t find a version of a package that matches the current environment when doing npm install whatever
.