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

@architect/sandbox

Package Overview
Dependencies
Maintainers
4
Versions
323
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@architect/sandbox

Architect dev server: run full Architect projects locally & offline

  • 1.13.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6K
decreased by-61.74%
Maintainers
4
Weekly downloads
 
Created
Source

@architect/sandbox

Architect dev server: run full Architect projects locally & offline in a sandbox

GitHub CI status

Install

npm i @architect/sandbox

Run locally

npx sandbox

API

sandbox.cli({ver}, callback)

Invokes sandbox.start() to start a sandbox instance, passing the parameter object in. Then sets up a filesystem watcher for changes to:

  1. Files within shared folders (src/shared/, src/views/, etc.), in which case it will re-hydrate all functions with the new files, and
  2. The Architect project manifest file, in which case it will re-start the HTTP server by calling into http().

Prints the specified ver on init, or falls back to the version string defined in this project's package.json.

sandbox.db.start(callback)

Starts a singleton local in-memory DynamoDB server, automatically creating any tables or indexes defined in the project manifest's @tables pragma. Also creates a local session table.

Returns an object with a close([callback]) method that gracefully shuts the server down.

Invokes callback once the DB is up and listening.

sandbox.events.start(callback)

If Architect project manifest defines @queues or @events, sets up interprocess communication between your events and queues via a tiny web server.

Returns an object with a close([callback]) method that gracefully shuts the server down.

Invokes callback once the server is up and listening.

sandbox.http.start(callback)

If Architect project manifest defines defines @http or [@websocket][websocket] routes, starts the necessary servers and sets up routes as defined in the project manifest.

Invokes callback once the server is up and listening.

sandbox.http.close([callback])

Closes any servers started via sandbox.http.start().

sandbox.start({port, options, quiet}, callback)

Initializes the sandbox; first checks that ports are available to consume, prints a banner, loading basic environment variables and necessary AWS credentials, and sets up any local DBs via sandbox.db.start(), events or queues via sandbox.events.start(), HTTP handlers via sandbox.http.start().

Invokes callback once everything is ready, passing null as the first parameter and sandbox.end as the second parameter.

Return a promise if callback is falsy.

sandbox.end([callback])

Shuts down the sandbox, closing down all running servers and services. Returns a promise if callback is falsy.


Example Usage

let sandbox = require('@architect/sandbox')

FAQs

Package last updated on 14 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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