• Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    TypeScript
  • License
    GNU General Publi...
  • Created almost 3 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

REPL-driven development for NodeJS

Skerrick

noun: skerrick
the smallest bit.
"there's not a skerrick of food in the house"

REPL-driven development for NodeJS

  • Programming in tiny increments - Apply patches to your running program without having to restart it
  • Tell me more!

Inspired by (check them out!):

  • SLIME: The Superior Lisp Interaction Mode for Emacs
  • CIDER: The Clojure(Script) Interactive Development Environment that Rocks!
  • Calva: integrated REPL powered environment for enjoyable and productive Clojure and ClojureScript development in Visual Studio Code

โš ๏ธ DISCLAIMERS โš ๏ธ

  • THIS PROJECT IS IN ALPHA STATE! I WOULD APPRECIATE IT IF YOU REPORT ANY BUGS/ISSUES YOU FIND. MAYBE EVEN CONTRIBUTE PATCHES/FIXES IF YOU HAVE THE TIME ;)
  • The code is currently very messy and not well-written. I just wanted to get a working prototype out of the door as quickly as I could. I will be improving the implementation over time. Feel free to give me suggestions if you have any!

VSCode

โœจ Documentation โœจ

Emacs

MELPA

Demos

Basic

Basic usage

Module support

Module support

Requirements

  • node/npm installed and accessible by Emacs

Installation

skerrick is in MELPA

Or, if you're using Quelpa:

(quelpa '(skerrick :repo "anonimitoraf/skerrick" :fetcher github))

;; Needs to be run on the very first install of skerrick. Or when you want to upgrade.
(unless (equal (shell-command-to-string "type skerrick") "skerrick not found\n")
  (skerrick-install-or-upgrade-server-binary))

;; Should be run in a JS buffer; it is buffer specific.
;; (skerrick-start-server)

;; Now main function, entry point is:
;; M-x skerrick-eval-region

It may also be helpful to provide a quick keyboard shortcut. E.g., C-x C-e evaluates ELisp, so let's mimic that for JS buffers:

;; Evaluate a region, if any is selected; otherwise evaluate the current line.
(bind-key
 "C-x C-e"  (lambda ()
              (interactive)
              (if (use-region-p)
                  (skerrick-eval-region)
                (beginning-of-line)
                (set-mark-command nil)
                (end-of-line)
                (skerrick-eval-region)
                (pop-mark)))
 'js-mode-map)

Configuration

Configuration Desc Default
skerrick-server-port Port to run the skerrick server on 4321
skerrick-result-overlay-face Face used to display evaluation results
skerrick-result-overlay-char-count-trunc Results with char count longer than this are truncated 120
skerrick-pop-result-buffer-for-stdout Show result buffer if stdout is non-empty t
skerrick-pop-result-buffer-for-stderr Show result buffer if stderr is non-empty t

Usage

Command Desc
skerrick-install-or-upgrade-server-binary Needs to be run on the very first install of skerrick. Or when you want to upgrade.
skerrick-start-server Starts the server. Note that your current buffer will be evaluated, so you probably want to run this command while being on your program's entry point file.
skerrick-stop-server Stops the server.
skerrick-eval-region Evaluates the selected region. Shows the eval result as an overlay. Stdout/stderr get written to the buffer *skerrick-stdout-stderr*.

Write a plug-in for your editor/IDE!

NPM

  • npm install -g skerrick - this installs the bin skerrick

    Invoked like so: skerrick PORT ENTRYPOINT_FULL_FILE_PATH

  • The REST protocol is as simple as it can be:

    • POST to /eval payloads of shape:
        {
          "modulePath": "/full/path/to/file/of/code/to/eval",
          "code": "const x = 42; console.log(x); x + x;"
        }
    • Response shape:
        {
          "result": "84",
          "stdout": "42",
          "stderr": ""
        }
  • ๐Ÿš€ Tell me about your plug-in so I can add it to this README! ๐Ÿš€

More Repositories

1

exercism.el

Emacs integration for https://exercism.org
Emacs Lisp
30
star
2

emacs-clippo

Clipboard Manager via Emacs!
Emacs Lisp
6
star
3

gripe

Emacs wrapper for https://github.com/bfontaine/grape
Emacs Lisp
5
star
4

clj-flx

Flexible fuzzy matching
Clojure
3
star
5

.doom.d

Doom-emacs config files
Emacs Lisp
3
star
6

nodejs-sockets-monitor

Get stats on how many sockets are active, connected, ready, have received data, etc.
TypeScript
2
star
7

sentry-capacitor-replay-repro

Repo that reproduces issues with Sentry Capacitor + Replays
TypeScript
2
star
8

anonimitoraf.github.io

Deployed to https://anonimitoraf.github.io
HTML
1
star
9

.dotfiles

Productive procrastination
Shell
1
star
10

speed-dial.el

Open your favourite files instantly as if you're using a speed dial
Emacs Lisp
1
star
11

babel-plugin-transform-commonjs-es2015-modules

A fork of https://gitlab.com/sebdeckers/babel-plugin-transform-commonjs-es2015-modules
TypeScript
1
star
12

Geoguess

Vue
1
star
13

emacs

Emacs config from scratch. I'm planning to migrate away from Doom so I can fully control what goes into my config
Emacs Lisp
1
star
14

anonimitoraf

1
star
15

clojure-rand-ref.el

Simple Emacs package for showing random https://clojuredocs.org/quickref items. Primarily for the goal of discoverability.
Emacs Lisp
1
star
16

project-euler

Haskell
1
star
17

comfykafka

A nice Kafka text user interface
Clojure
1
star
18

spacemacs-stuff

Emacs Lisp
1
star
19

issue-reproduction-reagent

Repository for reproducing Reagent issues
Clojure
1
star
20

brave-clojure

Code content, exercises, etc for https://www.braveclojure.com/
Clojure
1
star
21

emacs-from-scratch

Repo containing emacs config files primarily for reproducing issues with emacs packages
Emacs Lisp
1
star