Add support LiveScript

This commit is contained in:
Namhyeon Go 2022-11-29 14:42:34 +09:00
parent 6a9127baa9
commit b72d7762fa
3 changed files with 14 additions and 2 deletions

View File

@ -24,6 +24,6 @@ main = (args) ->
console.log bitlist.join(',')
console.log JSON.stringify(kids)
console.log "Hello world, CoffeeScript"
console.log fortune.sayFortune("Foutune!")
fortune.sayFortune("foutune!")
exports.main = main

View File

@ -1,3 +1,5 @@
fortune = require "lib/fortune.ls"
# Easy listing of implicit objects
table1 =
* id: 1
@ -19,5 +21,6 @@ main = (args) ->
console.log JSON.stringify(table1)
console.log JSON.stringify(table2)
console.log "Hello world, LiveScript"
fortune.sayFortune "fortune!"
exports.main = main

9
lib/fortune.ls Normal file
View File

@ -0,0 +1,9 @@
###
# Fortune Cookie Reader v1.0
# Released under the MIT License
###
sayFortune = (fortune) ->
console.log fortune # in bed!
exports.sayFortune = sayFortune