Skip to content

Instantly share code, notes, and snippets.

@bn-l
bn-l / RegexPipe.mts
Created March 18, 2024 13:20
Using minipass to create a regex transform stream
import { Minipass } from "minipass";
export class RegexPipe extends Minipass<string, string> {
public regex: RegExp;
protected hasGroup: boolean;
private buffer: string = "";
constructor({ regex, hasGroup }: { regex: RegExp; hasGroup: boolean }) {
@bn-l
bn-l / cli-qol.md
Last active March 23, 2024 17:37
CLI QoL
@bn-l
bn-l / only_needed_components_lodash.md
Last active February 10, 2017 07:44
Importing only needed components from lodash

Keeping your bundle small

If you're concerned about the extra weight that lodash will add to your bundle you can install babel-plugin-lodash

npm install --save-dev babel-plugin-lodash

and add it to your .babelrc