Socket
Book a DemoInstallSign in
Socket

@betafcc/suss

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@betafcc/suss

Micro Library for JS Iterables

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

TODO

  • Make a working starting point
  • Convert to bundled entry point
  • Add Tests
  • Convert to TypeScript
  • Release

süß/JS

süß   /zyːs/
adj
   sweet, cute
noun
   the sound iteration makes over pure functional pipes

Install

npm install @betafcc/suss

Usage

Get an iterator/generator/iterable:

// Generate all Natural numbers
function* naturals() {
   for (let i = 0; true; i+=1)
       yield i;
}

Use the Fluent API:

import {suss} from '@betafcc/suss';

// Log all even squares
suss(naturals())
    .map(x => x*x)
    .filter(x => x % 2 === 0)
    .forEach(el => console.log(el));

Use the flow/pipe API:

import { flow,
         map, filter, forEach } from '@betafcc/suss';

// Log all even squares
flow(naturals())(
    map(x => x*x),
    filter(x => x % 2 === 0),
    forEach(el => console.log(el)),
);

Keywords

iterable

FAQs

Package last updated on 14 May 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