npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xtsc

v1.3.3

Published

A Typescript loader

Downloads

29

Readme

XTSC

A Typescript loader, bundler and compiler, that use SWC and ESBUILD.

  • To install: npm i -g xtsc or npm i -D xtsc

  • To use: xtsc [action] [file|flags] or npx xtsc [action] [files|flags] or xtsc [file][flags] to run a single file

*New: New command available: xwtsc. What this new command does: | Action | What it does | |--|--| | blank space | REPL | | build | build the project | | bundle entry point output point | bundle the project | | watch file | Watch and run on changes | | run file or only file| Run program | | check | Type check the whole project | | init | Create a tsconfig.json |

|flag| Available on | |--|--| | --watch | build, bundle, check | | --args: [args for program] | watch, run (must be the last flag)| | --minify | bundle | | --tsconfig your tsconfig.json | every command |

The point of this new command, is to use the most Typescript's API services, so, will build using the Typescript's Compiler, will make typecheck before initialize the program, and, will use the transpileModule method.

*New:

Now, you can use path alias in your project. Can be used in run, watch, bundle, build

Actions:

| Action | What it does | |--------------|--| | blank space | REPL | | build root dir build dir or file out file| Build the project/file | | bundle file bundle file | Bundle a file | | watch file | Watch for changes in .ts .mts and .cts files | | run file or only file | Run a .ts file| | check | Type check the whole project | | init | Create a tsconfig.json file |

Each action has certain flags:

Build:

  • --minify Will minify each Javascript file.

  • --sourceMaps Will save the the source map of each file.

  • --watch Watch for changes.

  • --noClear Avoid clearing the console when you are using the --watch flag.

Bundle:

  • --minify Will minify the .js file.

  • --sourceMaps Will save the source map of the file.

  • --watch Watch for changes.

  • --noClear Avoid clearing the console when you are using the --watch flag.

Run / Watch:

  • --noClear Avoid clearing the console when the program initializes.

  • --args= [...args] Args for your program, this flag, must be the last flag.

Check:

  • --watch Watch for changes.

  • --tsconfig [tsconfig]Will search and use the provided tsconfig.

Notes:

My idea, is, in the case you are using "type": "module" in your package.json, you import all your Typescript files with Ts extensions, so, you can use allowImportingTsExtensions in your tsconfig.json.

With this idea, when you build your project, xtsc will change all the Ts extensions to Js extensions.

In the case you are using "type": "commonjs", you can also import your Typescript files with Ts extensions extension, but, is not necessary.

Important:

In the case you are using "type": "module" , xtsc will obligate you to import all your Typescript files with Ts extensions.

In other case, if you are using "type": "commonjs", you may not have to worry about this, but, in the case you import your Typescript files with Js extensions, xtsc will obligate you to import your files with Ts extensions.

Remember, xtsc will change the .ts | .mts | .cts extensions to .js | .mjs | .cjs extensions on build.

And, xtsc will respect .mts and .cts extensions!