New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arch-stream

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arch-stream

Modular stream for domain and data oriented program architecture design.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

ArchStream

Build Status Coverage Status Dependency Status

Modular stream for domain and data oriented program architecture design.

API

dist/arch-stream.d.ts

  • ArchStream
  • Proxy
  • Message

Install

$ npm i arch-stream
$ bower install arch-stream

Usage

Message and Thenable data cannot send directly.

Modular stream

import { A as ArchStream } from 'arch-stream';

const add1 =
  ArchStream<number>()
    .trans(n => ++n)
    .export(),
      add2 =
  ArchStream<number>()
    .import(add1)
    .import(add1)
    .export(),
      add3 =
  ArchStream<number>()
    .import(add1)
    .import(add2)
    .export();

ArchStream<number>()
  .import(add1)
  .import(add2)
  .import(add3)
  .export()
  .read(n => console.log(n))
  .write(0)  // => 6
  .write(9); // => 15

Thenable

import { A as ArchStream } from 'arch-stream';

ArchStream<any>()
  .trans(n => new Promise(resolve => setTimeout(_ => resolve(n / 10), 100 - n)))
  .export()
  .read(n => console.log(n))
  .write(10)  // => 1
  .write(20); // => 2

Proxy

Unable use on TypeScript because untyped.

State
import { A as ArchStream } from 'arch-stream';

ArchStream<number>()
  .proxy(A.Proxy.State({index: [0, 1], indexer: n => n % 2, void: false}))
  .trans(n => n, n => -n)
  .export()
  .read(n => console.log(n))
  .write(1)  // => -1
  .write(2); // =>  2
Custom

Call order constraints (Type constraint)

Possible
  • trans > trans
  • trans > export
  • trans > proxy
  • proxy > trans
  • proxy > proxy
  • import > import
  • import > export
  • export > read
  • read > write
Impossible
  • trans > import
  • trans > read
  • export > trans
  • export > import
  • import > trans
  • import > read
  • read > read
  • write > read

Browser

  • Chrome
  • Firefox
  • IE9+
  • Phantomjs

Test

$ npm i && grunt install
$ grunt test
$ grunt perf

Keywords

FAQs

Package last updated on 13 Sep 2015

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