npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gamely/core-native-html5

v0.2.3

Published

create your own game-engine with just javascript or lua.

Readme

core-native-html5

npm cdn

create your own game-engine with just javascript or lua.

Built-in Modules

| driver name | description | | :-------------- | :---------- | | fengari | lua vm in es6 | wasmoon | lua vm in wasm | keyboard | inputs events | gamepad | inputs events | runtime | tick and draw events | resize | auto resize width and height | player-fake | fake video player using html element <canvas> | player-html5 | video player using html element <video> | player-videojs | video player using videojs library | player-youtube | video player using iframe youtube integration | fengari-check | check for a lua virtual machine(also wasmoon-check fengari-or-wasmoon-check) | fengari-jsonrxi | thirdy party library json for core native api(use string: https://cdn.jsdelivr.net/gh/rxi/json.lua/json.lua)

Third-party Libraries

<!-- fengari -->
<script src="https://cdn.jsdelivr.net/npm/fengari-web@latest/dist/fengari-web.min.js"></script>

<!-- wasmoon -->
<script type="module">
import { LuaFactory, LuaMultiReturn } from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm'
window.LuaFactory = LuaFactory
window.LuaMultiReturn = LuaMultiReturn
</script>

<!-- videojs -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/video.min.js"></script>

Gly Engine

replace @latest with the engine version you want.

const gly = await CoreNativeHtml5()
    .setElementRoot('main')
    .setElementCanvas('#gameCanvas')
    .addLibrary('wasmoon', LuaFactory, LuaMultiReturn)
    .addLibrary('runtime', {uptime: false})
    .addLibrary('keyboard')
    .addLibrary('resize')
    .setEngine('https://cdn.jsdelivr.net/npm/@gamely/gly-engine@latest/dist/main.lua')
    .setGame('game.lua')
    .build()

Love2D

support wasmoon and fengari!

const keymap = [
    ['KeyZ', 'a'],
    ['KeyX', 'b'],
    ['KeyC', 'c'],
    ['KeyV', 'd'],
    ['Enter', 'a'],
    ['ArrowUp', 'up'],
    ['ArrowDown', 'down'],
    ['ArrowLeft', 'left'],
    ['ArrowRight', 'right'],
    ['ShiftLeft', 'menu'],
];

const gly = await CoreNativeHtml5()
    .setElementRoot('main')
    .setElementCanvas('#gameCanvas')
    .addLibrary('fengari', fengari)
    .addLibrary('runtime', {unfocus_pause: true})
    .addLibrary('keyboard', keymap)
    .addLibrary('resize')
    .setEngine('https://cdn.jsdelivr.net/npm/@gamely/love-engine@latest/dist/main.lua')
    .setGame('main.lua')
    .build()

Engine writen in lua

const gly = await CoreNativeHtml5()
    .setElementRoot('main')
    .setElementCanvas('#gameCanvas')
    .addLibrary('wasmoon', window.LuaFactory, window.LuaMultiReturn)
    .addLibrary('fengari', window.fengari)
    .addLibrary('fengari-jsonrxi', 'https://cdn.jsdelivr.net/gh/rxi/json.lua/json.lua')
    .addLibrary('fengari-or-wasmoon-check')
    .addLibrary('player-videojs', window.videojs)
    .addLibrary('runtime')
    .addLibrary('keyboard')
    .addLibrary('resize')
    .setEngine('engine.lua')
    .setGame('game.lua')
    .build()

Baremetal javascript

const gly = await CoreNativeHtml5()
    .setElementCanvas('#gameCanvas')
    .build()

gly.engine.on('draw', () => {
    gly.backend.native_draw_color(0xFFFFFFFFF)
    gly.backend.native_draw_rect(0, 50, 50, 50, 50)
})

function tick() {
    gly.frontend.native_callback_loop()
    gly.frontend.native_callback_draw()
    window.requestAnimationFrame(tick)
}

gly.frontend.native_callback_init()
tick();

Custom engine javascript

function awesome_game(loop, draw, keys) {
    let color = 0x00FFFFFF

    loop.callback(() => {

    })
    draw.callback(() => {
        draw.color(color)
        draw.rect(0, 10, 20, 30, 40)
    })
    keys.callback((key, press) => {
        if (key == 'a' && press) {
            color = 0xFF0000FF
        }
    })
}
function awesome_engine(game) {
    CoreNativeHtml5().setElementCanvas('#game').addLibrary('keyboard').addLibrary('runtime').build().then((gly) => {
        const loop = {
            callback: (f) => gly.on('loop', f)
        }
        const draw = {
            color: gly.backend.native_draw_color,
            rect: gly.backend.native_draw_rect,
            callback: (f) => gly.on('draw', f)
        }
        const keys = {
            callback: (f) => gly.on('keyboard', f)
        }
    
        game(loop, draw, keys)
    })
}
awesome_engine(awesome_game)