Reading from the Standard Input (stdin) using PureScript

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • purescript-node-process

    Access the global Node.js process object

  • First of all, to read from the Standard Input (stdin) the library purescript-node-process is needed. This library exposes stdin which is a Readable (a simple readable stream) and it will be the key component around which we’ll create our function. Since we are dealing with a simple stream, what we want to create is a function that takes that same stream and return a new string:

  • purescript-st

    The ST effect, for safe local mutation

  • This looks a bit messy but it’s actually simple. Since the process of handling a stream is “event-driven” we are going to use a safe mutable string (from purescript-st) to accumulate our input every time the onDataString event will be triggered. This whole process is asynchronous, meaning that we have to wait for the onEnd event (or onError if something bad happened) to actually return the accumulated string. The effect monad Aff solves this through makeAff. The res callback has to be called with an Either parameter, and only when this callback will be triggered the program can continue its execution.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Show HN: Switch to Audible Tab [WebExtension]

    1 project | news.ycombinator.com | 25 Feb 2024
  • Namma Yatri – open-source Uber/Lyft Alternative (In active use in India)

    1 project | news.ycombinator.com | 17 Jan 2024
  • Typelevel Regular Expressions

    1 project | news.ycombinator.com | 27 Sep 2023
  • Looking for a Tool to Easily Install and Configure Chrome Extensions

    1 project | /r/AskProgramming | 13 Jul 2023
  • Change an element inside SVG

    2 projects | /r/purescript | 19 Jun 2023