GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ceifa/demoon: Lua + Node = demoon

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.vscode
.vscode
 
 
bin
bin
 
 
example
example
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

demoon

You love Lua but the runtime API is very weak and you don't want to handle and learn a lot of different luarock libraries? You came at the right place! This project aims to offer the bests of Lua and NodeJS together.

Don't use this in production!

Usage

You don't need lua installed to run demoon, but you need node and npm as well, firstly, install demoon globally:

$: npm i -g demoon

Then run it passing your entry lua file:

$: demoon app.lua

Example

This is a little sample code to demonstrate how demoon is powerful and bridges well with nodeJS:

-- you can require node modules (package.json/node_modules works as well)
local http = require('http')

-- you can require js modules and lua files
-- require('./myjsmodule.js')
-- require('./myluamodule.lua')

local port = os.getenv('PORT') or 8080

function sleep(ms)
    -- you can use and create promises
    return Promise.create(function(resolve)
        setTimeout(resolve, ms)
    end)
end

-- top level await works!
sleep(1000):await()

http.createServer(async(function (req, res)
    -- you can await inside async bounded functions
    sleep(1000):await()

    res:write('Hello World!')
    res['end']()
end)):listen(port)

print('Your server is running on port ' .. port .. '!')

About

Lua + Node = demoon

Resources

Readme
MIT license
Activity

Stars

79 stars

Watchers

4 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.