Skip to content

Go-style synchronization primitives for JavaScript/TypeScript

License

Notifications You must be signed in to change notification settings

okdaichi/golikejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

104 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golikejs

License: MIT

Reimplementation of Go's concurrency and utility primitives for JavaScript and TypeScript runtimes.

golikejs is a library that brings familiar Go designs to JavaScript and TypeScript. It aims to provide practical API compatibility with Go’s standard library and offers Go-style implementations such as concurrency primitives and I/O utilities.

Packages

  • sync — Synchronization primitives for concurrent programs.
  • context — Context utilities for cancellation and timeouts.
  • bytes — Byte-slice helpers and buffer utilities.
  • io — I/O primitives and small helpers.

Installation

Package Manager Command
Deno deno add jsr:@okdaichi/golikejs
npm npx jsr add @okdaichi/golikejs
pnpm pnpm i jsr:@okdaichi/golikejs
Bun bunx jsr add @okdaichi/golikejs
yarn yarn add jsr:@okdaichi/golikejs
vlt vlt install jsr:@okdaichi/golikejs

Quick Start

import { Mutex } from 'jsr:@okdaichi/golikejs/sync';

const m = new Mutex();
await m.lock();
try {
  // critical section
} finally {
  m.unlock();
}

For detailed examples and API documentation, see the individual package READMEs.

Development

This project uses Deno for development and testing.

Prerequisites

Commands

Task Command
Test deno task test
Test with coverage deno task test:coverage
Format code deno task fmt
Lint code deno task lint
Type check deno task check

Contributing

See CONTRIBUTING.md for guidelines.

License

See LICENSE for details.

About

Go-style synchronization primitives for JavaScript/TypeScript

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •