sharat
v0.2.0
Published
I wanted my students to start web development with TypeScript, but without the overhead of comiling TS files, so I created Sharat.
Downloads
8
Readme
Sharat
I wanted my students to start web development with TypeScript, but without the overhead of comiling TS files, so I created Sharat.
Sharat is a static file server, similar to other projects such as serve, live-server and http-server to name a few. However, Sharat would also compile TS files before serving them, making development with TypeScript feel like using JavaScript directly.
Some of Sharat's features:
- Serve static files from a desired folder
- Compile TS and SCSS files before serving
- Configure TypeScript compilation by using a tsconfig.json file
- Watch for file changes and refresh the page
[!CAUTION]
DO NOT USE Sharat IN PRODUCTION!
Sharat is meant for learning purposes and POCs, please compile and serve your application properly in production.
Usage
The recommended usage is with NPX.
From a terminal, go to the project you'd like to serve, and run:
> cd to/site/root
> npx sharatThis would start the development server and serve files from the specific folder you're in.
A less recommended option is with a global installation.
Start by installing Sharat globally using NPM:
> npm i -g sharatThen go to the desired folder and run Sharat directly:
> cd to/site/root
> sharatDebugging
In case you want to see the debug logs, you should set the environment variable SHOW_DEBUG_LOGS to "true".
It's also possible to create a sharat.env file in the root directory you're serving, and add the setting there:
# path/to/site/root/sharat.env
SHOW_DEBUG_LOGS=trueChange log
- v0.2.0
- Ignore changes to git related files and files from .gitignore
- v0.1.0
- Added auto refresh on file changes
- Added
SHOW_DEBUG_LOGSenvironment variable - Split from single file to multiple files
- Create readme file
- v0.0.3
- Initial release
