https://github.com/fabiosantoscode/infralang
https://github.com/fabiosantoscode/infralang
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fabiosantoscode/infralang
- Owner: fabiosantoscode
- Created: 2018-03-30T20:35:01.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-08T15:29:14.000Z (over 7 years ago)
- Last Synced: 2025-03-18T07:17:25.517Z (11 months ago)
- Language: JavaScript
- Size: 237 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# infralang
[](https://travis-ci.org/fabiosantoscode/infralang)
Create your code on AWS lambda in a single place!
## infralang -e
```bash
♥ bin/infralang -e '(+ 1 1)'
2
♥ bin/infralang -e '(+ 2 4)'
6
```
## infralang -c
```bash
♥ bin/infralang -c '(console.log (+ 2 4))'
(async () => {
return await console.log(2 + 4)
})().catch(error => { console.error(error) })
```
## (set variableName value)
```lisp
(set variablename (sns "sns-topic"))
```
## (loop [name value name2 value2] (recur))
```lisp
(set list [1 2 3])
(loop [l list]
(console.log l)
(if l.length
(recur (l.slice 1))))
```
## (fn [arg1 arg2 ...] code...)
```lisp
(fn [msg] onMessage
(notif.publish {hello: "world"}))
(set notif (sns "sns-topic"))
(notif.subscribe onMessage)
```
## (fetch "url")
```lisp
(fetch "http://www.example.com")
```
## (lambda "name" (fn [] null))
```lisp
(set x (lambda "functionName" (fn [x]
(console.log "hello" x))))
(x.call "param")
```