Skip to content

Latest commit

 

History

History
 
 

example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Atdgen for bucklescript, the example

A detail explanation of this example is available at Getting started with atdgen and bucklescript

Compile the project

yarn
yarn atdgen # required only if src/meetup.atd has been modified
yarn build

Run it

$ echo "[]" > events.json
$ nodejs src/cli.bs.js add louis [email protected]
$ nodejs src/cli.bs.js print
=== OCaml/Reason Meetup! summary ===
date: Tue, 11 Sep 2018 15:04:13 GMT
access: public
host: louis <[email protected]>
guests: 1
$ nodejs src/cli.bs.js add bob [email protected]
$ nodejs src/cli.bs.js print
=== OCaml/Reason Meetup! summary ===
date: Tue, 11 Sep 2018 15:04:16 GMT
access: public
host: bob <[email protected]>
guests: 1
=== OCaml/Reason Meetup! summary ===
date: Tue, 11 Sep 2018 15:04:13 GMT
access: public
host: louis <[email protected]>
guests: 1
$ cat events.json
[
  {
    "guests": [
      {
        "email": "[email protected]",
        "name": "bob"
      }
    ],
    "date": 1536678256177,
    "host": {
      "email": "[email protected]",
      "name": "bob"
    },
    "name": "OCaml/Reason Meetup!",
    "access": "Public"
  },
  {
    "guests": [
      {
        "email": "[email protected]",
        "name": "louis"
      }
    ],
    "date": 1536678253790,
    "host": {
      "email": "[email protected]",
      "name": "louis"
    },
    "name": "OCaml/Reason Meetup!",
    "access": "Public"
  }
]