Skip to content

lightweight tool that convert a file to a raw typscript string

License

Notifications You must be signed in to change notification settings

nicolasventer/raw-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

raw-ts

raw-ts is a lightweight tool that convert a file to a raw typscript string.
unraw-ts is the opposite tool that convert a raw typscript string to a file. (only raw-ts is documented since usage is the same)

Usage

Download the latest release from the release page.

Put the executable in your path.

Run the following command:

raw-ts <file>

Example

Content of example/wait.ts:

export const wait = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
raw-ts example/wait.ts

Output (content of example/waitRaw.ts):

export default "export const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\r\n";

You can then import the file in your project (content of example/print.ts):

import waitRaw from "./waitRaw";

console.log(waitRaw);

Development

Install

bun install

Run

bun run dev <file>

Build

bun run build

Licence

MIT Licence. See LICENSE file. Please refer me with:

Copyright (c) Nicolas VENTER All rights reserved.