Skip to content

Instantly share code, notes, and snippets.

View amatiasq's full-sized avatar

A. Matías Quezada amatiasq

View GitHub Profile
@amatiasq
amatiasq / esm.ts
Last active September 23, 2021 11:57
const extensions = {
js: 'application/javascript',
ts: 'application/typescript',
jsx: 'text/jsx',
tsx: 'text/tsx',
} as const;
type Extensions = typeof extensions;
type ValidExtension = keyof Extensions;
type ValidMediaType = Extensions[ValidExtension];
@amatiasq
amatiasq / CSVReader.js
Created November 9, 2018 11:10
CSV Parsers
const fs = require('fs');
const { promisify } = require('util');
const fs_open = promisify(fs.open);
const fs_read = promisify(fs.read);
const fs_close = promisify(fs.close);
let debug;
try {
debug = require('debug');
} catch(error) {