An open API service indexing awesome lists of open source software.

https://github.com/vepeckman/jsexport.nim

CommonJS exports for Nim
https://github.com/vepeckman/jsexport.nim

commonjs javascript nim

Last synced: about 1 month ago
JSON representation

CommonJS exports for Nim

Awesome Lists containing this project

README

        

# jsExport.nim
CommonJS exports for Nim

# What is this?
A simple Nim macro that allows you to export Nim procs and objects to JavaScript via CommonJS modules. The macro produces `module.exports` statements from the given input.

# Why is this?
This macro was written in order to descrease friction between Nim and the JavaScript ecosystem. By producing valid CommonJS modules, this macro makes it easier for JavaScript to consume Nim.

# Examples
```nim
jsExport:
"nimGreet" = greet # export with a different name
greetPerson # export with the same name
(name, person) # comma seperated list of exports
```