jaredpalmer / jaredpalmer/backpack

Feature request: REPL

Open
#24 4 comments 0 reactions 0 assignees View on GitHub
Priority: Low Status: Feature Request Status: Help Wanted Type: Enhancement
Dominant language
JavaScript
Stars
4.4k
Forks
164
PR merge metrics
No merged PRs in 30d

Description

I usually add a REPL to my apps in development mode with some context variables like `express`, the database ORM and some other variables like this:

```js
import express from 'express';
import mongoose from 'mongoose';
import repl from 'repl';

const app = express();
// ...

if (process.env.NODE_ENV === 'development') {
const instance = repl.start({
prompt: 'app > ',
});
instance.context.app = app;
instance.context.mongoose = mongoose;
}
```

A huge feature would be adding a REPL to `npm run dev` with backpack. Even better with `async/await` support.

```sh
$ backpack
DONE Compiled successfully in 1645ms

> const songs = await mongoose.model('Song').find();
[ ... ]
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing how `npm run dev` invokes Backpack and where its development process is started. Define how the REPL should expose application context and support `async/await`; done means the shown Backpack workflow starts a usable development REPL with those capabilities.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system, cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.