Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shellyln/liyad-lisp-pkg-example
https://github.com/shellyln/liyad-lisp-pkg-example
javascript lisp liyad-cli node nodejs
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/shellyln/liyad-lisp-pkg-example
- Owner: shellyln
- License: other
- Created: 2018-11-13T22:05:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-14T22:30:41.000Z (over 5 years ago)
- Last Synced: 2024-04-24T02:26:53.891Z (8 months ago)
- Topics: javascript, lisp, liyad-cli, node, nodejs
- Language: Common Lisp
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# liyad-lisp-pkg-example
NPM package example for [Liyad](https://www.npmjs.com/package/liyad) Lisp interpreter [CLI](https://www.npmjs.com/package/liyad-cli).
## Install
```bash
$ npm install -g liyad-cli$ mkdir myapp
$ cd myapp
$ npm install liyad-lisp-pkg-example
```## Write the code
```bash
$ vi app.lisp
```app.lisp
```lisp
($let ex ($require "liyad-lisp-pkg-example"));; Benchmarks
($console-log (::ex:tarai 12 6 0))
($console-log (::ex:fib 10))
($console-log (::ex:fac 10));; Run the web server on port 3000.
($let url ($node-require "url"))(::ex:#get "/" (-> (req res)
($let u (::url:parse ::req:url))
(::res@writeHead 200 (# (Content-Type "text/html")))
(::res@end ($concat "hit / ," ::req:method "," ::u:path)) ) )(::ex:serve 3000) ($last "start server")
```## Run
```bash
$ liyad app.lisp12
55
3628800
start server
```