Socket
Book a DemoInstallSign in
Socket

jgo

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jgo

JavaScript on the server, the Go-way

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

jgo

JavaScript on the server, the Go-way

Examples

File IO

const fs = require("jgo/fs");
const csv = require("jgo/csv");

async function processCSV() {
  const inFile = await fs.open("input.csv");
  const inCSV = csv.reader(inFile);
  const outFile = await fs.create("output.csv");
  const outCSV = csv.writer(outFile);
  //read until EOF
  while(const row = await inFile.read()) {
    //process row
    row[1] = "my new text";
    //write each row as we read
    outfile.write(row);
  }
  inFile.close();
  outFile.close();
}

Concurrency

Outer async, resolve exits with 0, rejects with 1

const go = require("jgo");

//mirrors go-main
go.main(async () => {
  const list = [1, 2, 3];
  await go.map(list, n => n * 3);
  go.logf(list);
});

Concurrency

//TODO

Interfaces

//TODO typescript

FAQs

Package last updated on 17 Sep 2018

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