Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

strapi-repl

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-repl - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

31

index.js
const REPL = require("repl");
let initStrapiApp = async (pathToStrapiModule) => {
return await require(`${pathToStrapiModule}/node_modules/strapi`)().load();
};
let startStrapiREPL = async (pathToStrapiModule) => {
let initStrapiApp = async () =>
await require(`${pathToStrapiModule}/node_modules/strapi`)().load();
let strapi = await initStrapiApp();
let environment = process.env.NODE_ENV;
let strapi = await initStrapiApp(pathToStrapiModule);
// environment is set to development by default via strapi
const environment = process.env.NODE_ENV;
console.log(

@@ -32,16 +34,7 @@ `Strapi-REPL v${

async action() {
if (environment === "development") {
process.stdout.write("reloading");
let loadingIndicator = setInterval(
() => process.stdout.write("."),
250
);
repl.context.strapi = strapi = await initStrapiApp();
clearInterval(loadingIndicator);
console.log("");
} else {
console.log(
".reload is exclusively available in development environment"
);
}
process.stdout.write("reloading");
let loadingIndicator = setInterval(() => process.stdout.write("."), 250);
repl.context.strapi = strapi = await initStrapiApp(pathToStrapiModule);
clearInterval(loadingIndicator);
console.log("");
this.displayPrompt();

@@ -48,0 +41,0 @@ },

{
"name": "strapi-repl",
"version": "0.0.1",
"version": "0.0.2",
"description": "Strapi REPL console with improved features",

@@ -5,0 +5,0 @@ "main": "./bin",

@@ -6,12 +6,18 @@ # Strapi REPL

* async/await support
* await support
* `.reload` reloads your app (helpful in development)
* only runs a REPL (and doesn't start your webservice as well)
For security reasons, the `.reload` feature is only available in development mode.
## Installation
```sh
$ npm install -g strapi-repl
```
## Run
In any strapi project:
```sh
$ cd your_strapi_project
$ strapi-repl

@@ -18,0 +24,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc