Skip to content

typed-rocks/ts-worksheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript Worksheet

Get the results of your  or  code right in your IDE

Compatible with the major runtimes...

...and languages

Features

Real-time Code Execution

See the results of your code as you save the file, without the need to switch windows or execute your script separately.


Use different runtimes

Easily switch between , and to run your scripts. We try our best to handle compatibility issues for you.


Copy value on click

Just click on the inlay and get the value copied to clipboard.


Timetravel (only vscode)

Scrub through your code and see the exact order your code was executed. Especially useful for understanding async code.


Support for all kind of Imports

Effortlessly import any Node module or other files from your project into your worksheet. Whether you use CommonJS with require or ESM with import, we got you covered.


async and top level await support

You can effortlessly test your asynchronous code using Promises but also async/await.


Easy Activation

Just add //ts-worksheet or //ts-worksheet-with-variables to your file, and you're all set.


Per-Line activation

Just //? at the end of the lines you want to have the result shown.


Customisable

Change the colors and run behaviour yourself.

Usage

After installation, you have multiple ways of running the plugin.

Configure it first

You will now have a new icon in the your left gutter in VSCode which you can use to configure your plugin.

Run at save:

  1. Open a JavaScript or TypeScript file.
  2. Add //ts-worksheet or //ts-worksheet-with-variables at the top of the file.
  3. Start coding and save the file when you are ready! You'll see the output of your code directly in the editor.

The difference between //ts-worksheet and //ts-worksheet-with-variables is the later shows also the results of your variable initialization. So for example you will get the output of this line only with the later one:

const hello = 'hi';

Run from Command Palette:

  1. Open a JavaScript or TypeScript file.
  2. Open your Command Palette and run the command Run TypeScript Worksheet or Run TypeScript Worksheet without variables

This will use the configuration to run the worksheet once in your current file so you don't run it by accident when you save your file like with the comment approach.

ATTENTION: This is still an early version of the plugin. If you find any issues, Create an issue for it.

Feedback and Support

We value your feedback! If you encounter any issues or have suggestions for improvements, please feel free to reach out to us. Your input helps us make this tool even better for the developer community.

License

This plugin is licensed under MIT License.

About

The Repository for Issues of the Plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published