Skip to content

Instantly share code, notes, and snippets.

View Lastor-Chen's full-sized avatar

Lastor Lastor-Chen

  • Taipei
View GitHub Profile
@Lastor-Chen
Lastor-Chen / tarStreaming.ts
Last active July 27, 2026 07:32
Stream processing example: tar-stream -> openpgp -> fs.createWriteStream
import fs from 'node:fs'
import path from 'node:path'
import stream from 'node:stream'
import { ReadableStream } from 'node:stream/web'
import * as tar from 'tar-stream'
import * as openpgp from 'openpgp'
const files = [
'/path/to/file1',
@Lastor-Chen
Lastor-Chen / nvm-windows-auto-switch-node-for-git-bash.sh
Created October 11, 2022 15:31 — forked from yuanoook/nvm-windows-auto-switch-node-for-git-bash.sh
nvm-windows auto switch node version by current working directory for git-bash
# Put this in your ~/.bashrc please
# To set node version by folder
# run: echo "v8.5.0" > .nvmrc
nvm_echo() {
command printf %s\\n "$*" 2>/dev/null
}
# Traverse up in directory tree to find containing folder