Skip to content

Instantly share code, notes, and snippets.

@khalidx
khalidx / node-typescript-esm.md
Last active May 8, 2024 07:58
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@fuzzyfox
fuzzyfox / markdown.js
Created June 22, 2013 23:57
JavaScript: Simple Markdown Parser
/* jshint browser: true, devel: true */
/**
* preg_replace (from PHP) in JavaScript!
*
* This is basically a pattern replace. You can use a regex pattern to search and
* another for the replace. For more information see the PHP docs on the original
* function (http://php.net/manual/en/function.preg-replace.php), and for more on
* JavaScript flavour regex visit http://www.regular-expressions.info/javascript.html
*