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

swudo

v0.2.8

Published

A Fast LightWeight Parser and Runtime for Typescript

Downloads

8

Readme

Swudo Node.js CI swudo-version npm

A light weight Runtime and Parser Library for Typescript.

Why swudo?

  • Swudo is built-with-almost no Dependency other than typescript
  • Swudo provides a runtime so that you don't have to call typescript to transcompile your code
  • Swudo Compiles and Transpiles your code into Javascript Code at runtime produce the result. It heavily depends on the Typescript Compiler API.
  • Fast and Lightweight ⚡

How it works

Swudo compiles Typescript code into Javascript Code on runtime even if it is a script or a module file. It outputs a Javascript File on runtime if you are using a setTimeOut in your code you can inspect that file.

Installation

Npm

npm i -g swudo

Yarn

yarn add -D swudo

Using Git

git clone https://github.com/swudots/swudo
cd swudo
yarn install
yarn build
yarn cli // specify commands to swudo here

Usage

Via Cli

usage:
       Compiling and Running a Typescript Program - swudo <file> ?--out<file>
       
       info : Getting information about the process,
              eg: swudo info test/main.ts // this is a process to compile the program

       --extract, -e <file> <identifiers[]>, -e <file> <identifiers[]> : Extract parts from code by specifying identifiers.

       --extract-o, -eo : Just like extract command expects and output files as an argument *swudo -eo <ouput> <target> [identifiers]*

       --transpile, -t <file> ?--out <resultFile>?: Transpile Typescript and get the Compiled result in the console

       --docs, -d <file> ?--out <resultFile>?: Returns the documentation of the classes and funcions inside that file

       --bundle-d [...args] Bundle Declaration Files into a single types.d.ts file
                            The ...args expect Declaration files as arguments


       --out?, -o: Filename or path to append the output

       --help, -h: Get All Available Commands

       --version, -v: get version of the package

Execution

npx swudo [..args]

or
// if globally installed
swudo [...args]

Utilities

  • Bundling Declaration : swudo comes with a feature to bundle your typescript declarations. using the flag --bundle-d and specifying your declaration files. By default it outputs a file named types.d.ts in to your current working directory.You can also use the * to read declarations from a directory.But, keep in mind that never specify a non-directory value because it gonna overwrite directory stuff
    • eg: swudo --bundle-d *DirectoryBundl myTypes.d.ts the argument with * at first is a value with dir.
  • Transpilation: swudo can transpile your Typescript code into a Javascript.The moduleType used in the output will be the default module used in your package.json.To use it, you need to specify the flag --transpile or -t.It accepts only one file as the argument.You can output the file using --out or -o and specifying a filename or path to output the result.
    • eg: swudo --transpile main.ts --out main.js
  • Generate Documentation: At the early versions of swudo it only supported exported classes.But, now it support functions too! This feature can generate a simple documentation about your code.The result would in JSON Format.
    • eg: swudo --docs program.ts --out documentation.json or you can specify the shorthand -d
  • Extraction: Extraction is useful to extract Identifiers from your code.You only need to specify the identifiers and swudo will give you the results. You can output the result using --out or -o before using the --extract flag and giving your output file a name.Note that this is experimental
    • eg: swudo --extract main.ts myFunction myClass myInterface myType or you can specify the shorthand -e

TroubleShooting

We reccomend using extract at last while using cli

swudo --transpile main.ts --extract test.ts [identifiers]

But if you specify it like this

swudo --extract test.ts [identifiers] --transpile main.ts

You are gonna get some runtime errors or additonal logs or unwanted bugs

Contributing

Feel free to open a pull request or an issue.

If you just wanna add a new feature just open a issue before you open a PR

Cloning this repo:

git clone https://github.com/swudots/swudo.git
cd swudo
yarn install

Read the contributing guidlines: Read

Haven't read the Code of Conduct. Read

License

swudo is licensed under Apache License 2.0. Open