/fbarrel

Primary LanguageGoDo What The F*ck You Want To Public LicenseWTFPL

fbarrel

Given

test/a.tsx (export function fkbr(){})
test/b.tsx (export class Yolo{})

then running fbarrel -n cool -p test will write

test/barrel.ts
test/cool.ts

with barrel.ts:

export * from './a';
export * from './b';

and cool.ts:

import * as Cool from './barrel';
export { Cool };

So now you can do:

import {Cool} from './test/cool'

Cool.fkbr()