# replos

> REPL on steroids for typescript and javascript

Latest version **1.0.1-alpha** (published 2020-04-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install replos
pnpm add replos
yarn add replos
bun add replos
```

Provides the commands `replos`, `replos-server`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1-alpha |
| Published | 2020-04-21 |
| First published | 2020-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 99.2 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Tim Kutscha |
| Maintainers | tiku91 |
| Keywords | repl, typescript, javascript |

## Links

- npm: https://www.npmjs.com/package/replos
- Repository: https://github.com/tiku91/replos
- Homepage: https://github.com/tiku91/replos#readme
- Issues: https://github.com/tiku91/replos/issues
- npm.io page: https://npm.io/package/replos

## Dependencies (7)

- [source-map](https://npm.io/package/source-map.md) ^0.7.3
- [@babel/core](https://npm.io/package/@babel/core.md) 7.9.0
- [@babel/parser](https://npm.io/package/@babel/parser.md) 7.9.4
- [@babel/traverse](https://npm.io/package/@babel/traverse.md) 7.9.5
- [@babel/generator](https://npm.io/package/@babel/generator.md) 7.9.5
- [@babel/plugin-transform-typescript](https://npm.io/package/@babel/plugin-transform-typescript.md) ^7.9.4
- [babel-plugin-transform-es2015-modules-commonjs-simple](https://npm.io/package/babel-plugin-transform-es2015-modules-commonjs-simple.md) 6.7.4

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.1-alpha (latest) — 2020-04-21
- 1.0.0-alpha — 2020-04-21

## README

## REPLos the repl on steroids for javascript and typescript

REPLos is a tool that enables developers to keep working in a single context.

Without REPLos, you need to switch context every time you verify your codes correctness.

With REPLos, you write a short unit of functionality and immediately check for mistakes, by evaluating just the code you have written and not leaving your IDE.

Additional benefit: You can use the inputs you provided to generate unit tests.

![](doc/replos.gif)

## Status: Open Alpha

## Installation
#### 1. Install as global npm module
`npm i -g replos`

#### 2. start replos server
`replos-server`

default port is set to `9464` can be changed with `-p <PORT>`
e.g. `replos-server -p 9465`;

#### 3. start using the replos client
`replos repl "1 + 1"` or `replos repl -p <PORT> "1 + 1"`

#### 4. Wire your IDE to replos

For Intellij you can register replos as external tool. 
You can download and import ./ide-integration/intellij/exportedSettings.zip into intellij with File > Import Settings.
This settings-package contains replos commands as external tool and key-bindings to them.

### Commands
`replos <Command> <CommandArgs>`

| Command | Description |
| --- | --- |
| [call](#call) | Calls first named function<sup>1</sup> at location |
| [declare](#declare) | Declares word at location as variable |
| [find](#find) | Finds and evaluates $NodeType$ at location |
| [load](#load) | Loads file, line or word at location |
| [repl](#repl) | Pipes input unprocessed to the repl |
| [test](#test) | Generates test for function at location |

[1] Non-anonymous functions or anonymous functions which are immediately assigned to a variable are considered named functions.

### call 

`replos call $FilePath$ $LineNumber$ $ColumnNumber$`

### declare

`replos declare $FilePath$ $LineNumber$ $ColumnNumber$`

### find

`replos find $NODE$ $FilePath$ $LineNumber$ $ColumnNumber$`

Node is a string that matches against node types of the abstract syntax tree (https://babeljs.io/docs/en/babel-types)

e.g.
```
replos find VariableDeclaration ...
replos find Function ...
replos find Expression ...
```

### load

`replos load ...`

The behavior depends on the amount of arguments provided

`replos load $FilePath$` loads whole file

`replos load $FilePath$ $LineNumber$` load line

`replos load $FilePath$ $LineNumber$ $ColumnNumber` loads word at location

`replos load $FilePath$ $SelectionStartLine$ $SelectionStartColumn$ $SelectionEndLine$ $SelectionEndColumn$` loads everything between

### repl

sends code directly to to the node repl

e.g.:

`replos repl 1 + 1`

`replos repl .clear`

### test

Generates a test about the function at the location.
Can be configured to use jest or mocha and commonjs or modules.

`test $FilePath$ $LineNumber$ $ColumnNumber$`

## Other usages
Netcat to the repl server.

## License

[MIT](http://opensource.org/licenses/MIT)

Copyright (c) 2020-present, Tim Kutscha

---
_Source: https://npm.io/package/replos · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
