Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active December 25, 2025 12:39
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@PARC6502
PARC6502 / OpenSourceBaas.md
Last active December 28, 2025 10:00
List of open source, self hosted BaaS - Backend as a service

Backend as a Service

Note on sizes: a lot of those might be inaccurate as there might be many microservices required aside from the core release/docker image. I haven't tested these recently so I'm not sure

Supabase - ~94.9K stars

  • Designed explicitly as an open source Firebase alternative
  • Typescript based
  • Docker support
  • Full Postgres database with Realtime subscriptions

PocketBase - ~54.5K stars

# -*- coding: utf-8 -*-
import threading
from nose.tools import eq_
import celery
from celery._state import _get_current_app
eq_('3.0.22', celery.__version__)
eq_('default', _get_current_app().main)
@eligrey
eligrey / html-domparser.js
Last active March 9, 2025 03:34
DOMParser HTML extension - Now a polyfill since HTML parsing was added to the DOMParser specification
/*
* DOMParser HTML extension
* 2019-11-13
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */