Skip to content

Node.js → gox Cheat Sheet

Quick lookup: npm module → gox import path.

Language & utilities

npm / Node.jsgox importKey API
a ? b : cgox/condcond.If(cond, a, b)
a ?? bgox/condcond.Coalesce(a, b)
lodashgox/slice, gox/maputil, gox/strslice.Map, maputil.Pick
Promise.allgox/asyncasync.All(ctx, fns...)
setTimeoutgox/asyncasync.After(ctx, d, fn)
eventsgox/eventem.On, em.Emit
Buffergox/bufferbuffer.From, buffer.Concat

File system & OS

npm / Node.jsgox importKey API
fs.promisesgox/fsfs.ReadFile(ctx, path)
pathgox/pathpath.Join, path.Resolve
dotenvgox/envenv.Load(), env.Get("KEY", def)
child_processgox/execexec.Command(ctx, "ls")
osgox/osutilosutil.Hostname(), osutil.Homedir()
archivergox/archivearchive.ZipCreate, ZipExtract
zlibgox/compresscompress.Gzip, Gunzip
streamgox/streamstream.Pipe, Transform

Web

npm / Node.jsgox importKey API
expressgox/httphttp.New(), app.Get, app.Use
cors, helmet, morgangox/httphttp.CORS, Security, Logger
multergox/httphttp.ParseMultipart
express-sessiongox/httphttp.SessionMiddleware
express-rate-limitgox/httphttp.RateLimit
axios, fetchgox/clientclient.Get, client.Post
wsgox/wsws.HandleWS, ws.Dial
http-errorsgox/errerr.NotFound, err.BadRequest
url, querystringgox/urlurl.Parse, url.ParseQuery

Data

npm / Node.jsgox importKey API
zod, joigox/validatevalidate.Validate(&v)
JSON.parsegox/jsonjson.Parse, json.Stringify
knex, pggox/dbdb.From("t").Where(...).First
mongoosegox/mongocoll.FindOne, mongo.Eq
ioredisgox/redisrdb.Get, rdb.Set
papaparsegox/csvcsv.Read, csv.Write

Security

npm / Node.jsgox importKey API
bcrypt, cryptogox/cryptocrypto.HashPassword, SHA256
jsonwebtokengox/jwtjwt.Sign, jwt.Verify
uuid, nanoidgox/idid.NewUUID, id.NewNanoID
passportgox/authauth.Bearer, auth.APIKey

Infrastructure

npm / Node.jsgox importKey API
winston, pinogox/loglog.Info, log.With
node-cachegox/cachecache.Set, cache.Get
node-crongox/croncron.Schedule, cron.Every
bull, bullmqgox/queuequeue.Enqueue, Worker
nodemailergox/mailmail.Send
moment, dayjs, msgox/timetimex.Format, timex.ParseDuration
semvergox/semversemver.Parse, semver.Satisfies

Ecosystem guides (no gox package)

npm / Node.jsGo approachGuide
apollo-server, graphqlgqlgengraphql.md
@grpc/grpc-jsgoogle.golang.org/grpcgrpc.md
kafkajssegmentio/kafka-gokafka.md
@opentelemetry/*go.opentelemetry.io/otelopentelemetry.md
jest, vitesttesting, httptesttesting.md
socket.iogox/ws + patternsws.md

Install

bash
go get github.com/sahilkhaire/gox

Import only what you need — each package is independent:

go
import (
    "github.com/sahilkhaire/gox/http"
    "github.com/sahilkhaire/gox/db"
)

MIT Licensed · Built for Node.js developers moving to Go