0.0.1 • Published 1 year ago

@sawerjs/load-file v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@sawerjs/load-file

Load Typescript & Javascript files for both commonjs and esm using swc.

Usage

// some-file.ts
export const foo = 'bar';
import { loadFile } from '@sawerjs/load-file';

const { foo } = await loadFile('./some-file.ts');
// => bar

Arguments

  • filename: The path to the file to load.
  • cwd (optional): The current working directory.

Using with CommonJS

const { loadFile } = require('@sawerjs/load-file');

This package is part of sawer.