Skip to content

Instantly share code, notes, and snippets.

// Adapted from https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_transpiler_loader
import { readFileSync, writeFileSync } from 'fs'
import { dirname } from 'path'
import { URL, pathToFileURL, fileURLToPath } from 'url'
import esbuild from 'esbuild'
const baseURL = pathToFileURL(`${process.cwd()}/`).href
const tsExtensionRegex = /\.(tsx?)$/
function readJSON(path) {
function match(pattern, path) {
const pattern_components = pattern.split('/')
const path_components = path.split('/')
if (pattern_components.length !== path_components.length) {
return null
}
const params = {}
@nsivertsen
nsivertsen / import_map.json
Created April 7, 2020 08:43
Preact and htm on Deno
{
"imports": {
"htm": "https://unpkg.com/htm@3.0.3/dist/htm.module.js",
"htm/preact": "https://unpkg.com/htm@3.0.3/preact/index.module.js",
"preact": "https://unpkg.com/preact@10.3.4/dist/preact.module.js",
"preact-render-to-string": "https://unpkg.com/preact-render-to-string@5.1.4/dist/index.module.js"
}
}

Keybase proof

I hereby claim:

  • I am nsivertsen on github.
  • I am nsivertsen (https://keybase.io/nsivertsen) on keybase.
  • I have a public key ASA_FCmzwSIh2bzXcxG9E11CDhUf6R9TURnHWU2N-Qun-wo

To claim this, I am signing this object:

@nsivertsen
nsivertsen / Article.css
Created November 25, 2018 14:41
Svelte CSS
/*
I have an Article component, that has the following child components:
- Heading
- Paragraph
- Quote
- Image
- Gallery
- Embed
@nsivertsen
nsivertsen / .block
Last active March 14, 2017 19:17
Berlin Street Lights
license: mit
height: 800
border: no
@nsivertsen
nsivertsen / .block
Last active March 13, 2017 21:36
Berlin C02 2015
license: gpl-3.0
height: 960
border: no
@nsivertsen
nsivertsen / .block
Last active March 10, 2017 19:33
Berlin Population Density 2015
license: mit
height: 860
border: no