VS Code JavaScript REPL - Realtime feedback, besides your code (js, ts, vue, jsx, tsx, coffee)

栏目: IT技术 · 发布时间: 5年前

内容简介:JavaScript REPL is a javascript playground for Visual Studio Code with live feedback(logs or errors) as you type, besides your code, in a log explorer, or in an output channel. It supports Javascript, TypeScript, CoffeeScript and it can be used for develop

JavaScript REPL

JavaScript REPL is a javascript playground for Visual Studio Code with live feedback(logs or errors) as you type, besides your code, in a log explorer, or in an output channel. It supports Javascript, TypeScript, CoffeeScript and it can be used for development in Node.js projects or with front-end frameworks like React, Vue, Angular, Svelte etc.

VS Code JavaScript REPL - Realtime feedback, besides your code (js, ts, vue, jsx, tsx, coffee)

Features

By pressing cmd(or ctrl) + shift + l as shortcut or by using the command "JS Repl: Run" and by using console.log statement,you can display the result of whatever expression you want (Variable, Function, Object etc..). JS Repl can be activated on file types(.js, .ts, .coffee, .jsx, .tsx, .vue) or by launching "JS Repl: New ...". Users can check the available commands or the extension's configuration on the wiki pages.

  • JavaScript, TypeScript and CoffeeScript support
  • Node.js support
  • React.js & Vue.js compatible
  • Logs through comments or by using console.log
  • Show or copy value of an expression, without add comments or console.logs
  • Explorer window with the log values and errors
  • Output window with the log values and errors
  • Live code coverage
  • Show log values on edit or or on save.
  • Imported files support
  • Easy install for missing modules
  • Multi-file support for logs or errors per project
  • Async results(logs, errors) rendering
  • ui customization in coverage & log colors

Preview video

VS Code JavaScript REPL - Realtime feedback, besides your code (js, ts, vue, jsx, tsx, coffee)

Logging

Users can add logs in their code with the following ways:

// You can add logs by using console.log
console.log('We ♡ JavaScript!');

// or by using a comment line with equals sign at the end of an expression
const obj = {
  language: 'javascript'
}; //=

function hello() {
  return 'Hello World!';
}
// or a comment block with equals sign
hello(); /*= */

// or just type the variable name
obj;

// if the log represents an object you can use the dollar sign to access its properties
obj; //= $.language

//  also inside the log comments you can print every expression in your scope
hello(); //= obj

// Besides, you can select one or more variables or expressions and press right-click
//and select show value or explore the logs at the explorer on the left

Installation

Users can find the extension in marketplace at the following url:

https://marketplace.visualstudio.com/items?itemName=achil.vscode-javascript-repl

Javascript REPL requires node.js(>= 10.10.0) to be installed, and node executable to be available in PATH

Issues

Javascript REPL extension does not send any analytics data about the users or the kind of use that they are doing. So It will be very helpful, if you report an issue about a problem that you had during your repl sessions, and is really appreciated, if you provide any feedback about the extension user experience ♡. More information about issues or the part of the source code that have not been open-sourced yet users can find on wiki pages.

Credits

The icons that I used are not mine, so I would like to say thank you to the following sources or persons:

This extension uses under the hood a modified version of Parcel bundler. So I would like to say a big thank you to the guys there. You can find the modified version at the following branch .

Inspiration

I'd like to give a shout out to Quokka.js , which is a significantly more comprehensive and covers a lot more editors, if this extension interests you - check out that too. Also, when I started to play around this, I started with the code of the following extension


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

艾伦•图灵传

艾伦•图灵传

(英)安德鲁·霍奇斯 / 孙天齐 / 湖南科学技术出版社 / 2012-8-1 / 68.00元

《艾伦·图灵传:如谜的解谜者》是图灵诞辰100周年纪念版,印制工艺更为精美。本书是世界共认的最权威的图灵传记。艾伦?图灵是现代人工智能的鼻祖,在24岁时奠定了计算机的理论基础。二战期间,他为盟军破译密码,为结束战争做出巨大贡献。战后,他开创性地提出人工智能的概念,并做了大量的前期工作。因同性恋问题事发,被迫注射激素,后来吃毒苹果而死。作者是一名数学家,也是一名同性恋者。他对图灵的生平有切身的体会,......一起来看看 《艾伦•图灵传》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具