Skip to content

joshderochervlk-simplisafe/rescript-deno

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

cover

rescript-deno πŸ¦•

Use Deno with ReScript.

Note: This is a work in progress. πŸ—οΈπŸš§

Project Status: 🐲 Unstable, alpha-ish quality.

🚚 Install

You need to be on at least a recent RC of ReScript v11.

npm i rescript-deno @rescript/core

Include them in your rescript.json:

{
  "bs-dependencies": ["@rescript/core", "rescript-deno"]
}

rescript-deno is namespaced, so you'll find all modules listed under the main module RescriptDeno.

You're strongly encouraged to open RescriptDeno globally, to get the best possible developer experience. You do that by adding this to your rescript.json:

{
  "bsc-flags": [
    "-open RescriptCore",
    "-open RescriptDeno",
    "-open RescriptDeno.Globals"
  ]
}

This might be a matter of taste, but I recommend opening it to get the best experience.

This will make all of Deno available to you without needing to dip into the RescriptDeno module explicitly.

πŸ§‘β€πŸ”¬ Examples

A Simple HTTP Server:

Deno.serveWithOptions({port: 8007}, ~handler=req => {
  Response.new(String("Hello, world!"))
})->ignore

Make a request to a server:

let result = await fetch(String("https://rickandmortyapi.com/api/character"))
Console.log(await result->Response.json)

See playground directory in this repo for more examples.

πŸ“‘ Current Coverage

There's still a good amount of bindings missing. Here's what's currently available:

  • Broadcast Channel
    • BroadcastChannel
  • Cache API
    • Cache
    • CacheStorage
    • caches
  • Compression Streams API
    • CompressionStream
    • DecompressionStream
  • DOM APIs
  • DOM Events
  • Encoding API
    • TextDecoder
    • TextEncoder
    • atob
    • btoa
  • Errors
  • ES Modules
  • Fetch API
    • Body
    • EventSource
    • FormData
    • Headers
    • Request
    • Response
    • ResponseInit
    • BodyInit
    • fetch
  • File System
  • HTTP Server
    • Deno.serve
    • Deno.serveHttp
  • I/O
  • Network
    • Deno.connect
    • Deno.connectTls
    • Deno.listen
    • Deno.listenTls
    • Deno.networkInterfaces
    • Deno.resolveDns
    • Deno.shutdown
    • Deno.startTls
  • Observability
  • Performance
  • Permissions
  • Runtime Environment
    • Deno.version
    • Deno.pid
    • Deno.ppid
    • Deno.noColor
    • Deno.args
    • Deno.mainModule
    • Deno.build
    • Deno.env
    • Deno.exit
  • Scheduling
  • Streams API
  • Sub Process
    • Deno.ChildProcess
    • Deno.Command
    • Deno.kill
  • Testing
    • Deno.test
    • Deno.bench
  • Timers
  • Typed Arrays
  • Web APIs
  • Web Crypto API
  • Web File API
    • Blob
    • File
    • FileReader
  • Web Sockets
    • CloseEvent
    • WebSocket
  • Web Storage API
    • Storage
    • localStorage
    • sessionStorage
  • Web Workers
    • Worker
  • WebAssembly
  • WebGPU

🀝 Contributing

Contributions, issues and feature requests are welcome! See CONTRIBUTING.md for more info.

About

Use Deno with Rescript πŸ¦•

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • ReScript 100.0%