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 🙏

© 2024 – Pkg Stats / Ryan Hefner

wok.js

v1.1.50

Published

Minimalist frontend framework.

Downloads

17

Readme

wok.js

Minimalist component framework instead of Angular, React, Vue, Solid, Svelte, Lit

npm install -g wok.js installs the package globally

wokproj creates a wok.js project (Win11: Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted)

wok somename creates a new wok

fry starts your wok.js application

how to use

In the _woks folder there are your custom reusable components.

In the _build folder the parsed code resides, you can deploy it as you would deploy a vanilla project.

image image

<script> is responsible for behaviour and state

<script>
    let _x;
    let _y = 10 * _x;
    let _title;
</script>

and then modify them dynamically with html image

or with js. image

image

and then invoke them using dot notation. image

// on the wok itself
this.on('click', () => {    // or select('example-wok').on
    console.log("wok was clicked!");
});

// on elements inside the wok
select('h1').on('click', () => {
    console.log('h1 was clicked!');
});
const w = createElement('example-wok');   // or document.createElement('example-wok');
select('body').appendChild(w);            // or document.body.appendChild(w);

select('example-wok').remove();           // or w.remove();
select('example-wok').on('born', () => {
    console.log('wok was born!');
    _greet();
});

select('example-wok').on('death', () => {
    console.log('wok died!');
});
.on           --> .addEventListener

.off          --> .removeEventListener

select        --> document.querySelector

selectAll     --> document.querySelectorAll

createElement --> document.createElement

<example-wok> is responsible for structure

<example-wok>
    <lu>
        <li>${_x}</li>
        <li>${_y}</li>
        <li>${_x / _y}</li>
    </lu>
</example-wok>
<example-wok>
    <nested-wok title=${_myTitle}></nested-wok>
</example-wok>

<style> is responsible for appearance

<style>
    example-wok {
        display: block;
        border: solid 2px black;
    }
    h1 {
        color: ${_color};
    };
</style>

todo

✔ rebuild the component on save, so we don't have to 'npm run fry' every time, we make a change

✔ rebuild when save happens in regural html files too (not only in woks)

✔ find a way to shorten the command which creates a new wok, beacuse 'npm run wok wokname' is too long

? find a way to achieve highlighting in the css part of the wok, and override linting errors

? find a way to run the app from memory, and only build it when we want to deploy it

? templating language

? >selectors> for wok inner elements

? attrs as parameters in createElement()

? live-server should send refresh msg to the websocket only once after code parsing