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

cycle-express-driver

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cycle-express-driver

Cycle.js driver for Express framework

  • 3.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

cycle-express-driver npm version

Express.js driver for cycle.js forked from here

This is a experimental driver that allows you to have express router requests as stream, and use it in cycle.js apps.

API

streams of requests

API of router object is very similar to express.Router

router.METHOD(path) // -> stream of requests
router.get('/api/users')
  .filter(req => req.user)
  ...

nested streams of requests

Method route internally will create new express.Router and use (attach) it on current Router instance that will supply you with kind of isolated stream of request from the path.

let nestedRouter = router.route(path) // --> nested router attached on `path`
nestedRouter.METHOD(path) // -> stream of requests

streams of responses

Each incoming request from stream has unique id, you should put this id into to sink stream, so driver could make find a corresponding response (usually referred as res) object. So, such object passed to router sink steam:

{
  id: '123',
  status: 202,
  send: {a: 1, b: 2}
}

will set response status to 202 and send (calling send method on express's res object) {a: 1, b: 2}

Example

Check out this repo: Alex0007/cycle-express-hello-world

FAQs

Package last updated on 25 Feb 2017

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