
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Streaming Transports Relay Isomorphic Modules
npm i -S strim-js
or
yarn add strim-js
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
const express = require('express')
const { setStrimModules } = require('strim-js/dist/strimModules');
const app = express()
setStrimModules(app, { modulesPath: './myStrimModules' });
Client side
// client.js
import Strim from 'strim-js'
new Strim()
.pipe({
module: 'globals',
func: 'get',
args: [1, 2, 4],
})
.toServer()
.pipe({
module: 'globals',
func: 'runningSum',
})
.subscribe(
value => {
console.log('Current Value:', value)
},
err => {
console.error('Error Occurred:', err)
},
() => {
console.log('Done')
},
)
The core class which activates the strim
flow
strim
options.
'ws://localhost:4321/strim'
): The websocket url.:'global'
): The module name that will be imported for use of the pipe.'default'
): The function name within the module.:last func's environment
): The environment in which we want the function to run in (can be Environment.Client
or Environment.Server
).:false
): Whether to open in a worker or not.false
): Whether to open in a worker or not.console.log
): callback function that will occur every time a new value is received.console.error
): callback function that will occur when an error is received.strim
on.'/strim'
): The route path for strim
's endpoint.'node_modules'
): The path to the directory of the modules.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
Streaming Transports Relay Isomorphic Modules
The npm package strim-js receives a total of 2 weekly downloads. As such, strim-js popularity was classified as not popular.
We found that strim-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.