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

strim-js

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strim-js

Streaming Transports Relay Isomorphic Modules

  • 1.0.0
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

STRIM 🌊

Streaming Transports Relay Isomorphic Modules

Installation

npm i -S @wix/strim

or

yarn add @wix/strim

Usage

Write a module in your modules directory

// myModules/myAmazingModule.js

Server side (only if you need to run some of your modules on the server)

// server.js

Client side

// client.js

Full Example

import Strim from '@wix/strim'

new Strim()
  .pipe({
    module: 'globals',
    func: 'get',
    args: [1, 2, 4],
  })
  .pipe({
    module: 'globals',
    func: 'runningSum',
  })
  .subscribe(
    value => {
      console.log('Current Value:', value)
    },
    err => {
      console.error('Error Occurred:', err)
    },
    () => {
      console.log('Done')
    },
  )

API

Strim

The core class which activates the strim flow

Strim instance public methods
pipe(options)
  • module (Defalut 'global'): The module name that will be imported for use of the pipe.
  • func (Defalut 'default'): The function name within the module.:
  • args: arguments that will be sent to the piped function.
subscribe(options)
  • subscribe:

strimModules(app, options)

  • app: The Express application to set up strim on.
  • options (Optional): An object containing further options.
    • wsRoute (Default '/strim'): The route path for strim's endpoint.
    • modulesPath (Default 'node_modules'): The path to the directory of the modules.

Development

This module is written as part of Wix guild week, we'll be happy to have people help.

just clone the repo, yarn and yarn test

FAQs

Package last updated on 04 Mar 2019

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