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

voila-cmd

v1.2.2

Published

VoilaJS is a SAML ( Syntactically awesome markup language ) which boosts your static front-end development process.

Downloads

7

Readme

logo

voila build

Link to the presentation

VoilaJS is a SAML ( Syntactically awesome markup language ) which boosts your static front-end development process by allowing you to write your HTML in the form of modules, very similar to React but, with a much less steeper learning curve! ( All you need to know is to write JSON and that's easy! :stuck_out_tongue:)

The best part is HTML just became programmable :stuck_out_tongue: !! But how ?

What we thought was, CSS has it's programmable counter-part ( SASS ) why not HTML ? Guess what, now it has one, we call it SAML ( full form above ).

Just like other front-end frameworks, we too have out our own CLI to bootstrap your starter code.

Installation :

$ npm i -g voila-cmd

Next, we need to initialize a project, it's simple!

$ voila init

This generates a voila.json file in your project directory and also a config.js file where you write all your HTML logic, sound's weird saying that doesn't it! :stuck_out_tongue:

{
  title: 'forms',
  description: 'forms',
  css: 'Bootstrap',
  entry: 'index.html',
  author: '',
  License: 'ISC',
  git: false,
  config: 'config.js'
}

You can also add git repository to your project, voila automatically initializes a empty git repository with the needed files in .gitignore.

$ cd directory
exports.root = [
  {
    div: [
      {
        id: 'root',
        //ADD YOUR ELEMENTS HERE
        div: [
          {
            class: 'col-md-3'
          }
        ],
        h1: [
          {
            class: 'title1',
            value: 'first h1'
          },
          {
            class: 'title2',
            value: 'second h1'
          }
        ]
      }
    ]
  }
]

Above, is an example of a simple configuration, ( configurations need to be written in the JSON format ).

This JSON gets compiled to the HTML below:

<root >
  <div id="root" >
    <div class="col-md-3" >  </div>

    <h1 class="title1" > first h1 </h1>

    <h1 class="title2" > second h1 </h1>
  </div>
</root>

Once, you've written your own configuration, voila needs to parse and compile it into HTML, to do that run...

$ voila load

We have built our own parser that parses the JSON configurations and converts them into it's equivalent HTML syntax.

This HTML is can be viewed by starting the server, just run ...

$ voila start

Writing HTML in Component Style :

  • config.js
const { main } = require('./components/main');
const { navbar } = require('./components/navbar');

let Main = main();
let Navbar = navbar();

exports.root = [
  {
    div: [
      {
        id: 'root',
        //ADD YOUR ELEMENTS HERE
        Navbar,
        Main
      }
    ]
  }
]
  • main.js
module.exports.main = () => {
  return [
    {
      class: 'container',
      div: [
        {
          class: 'starter-template',
          h1: [
            {
              value: 'Bootstrap starter template'
            }
          ],
          p: [
            {
              class: 'lead',
              value: 'Use this document as a way to quickly start any new project.<br> All you get is this text and a mostly barebones HTML document.'
            }
          ]
        }
      ]
    }
  ]
}
  • navbar.js
module.exports.navbar = () => {
  return [
    {
      class: 'navbar navbar-expand-md navbar-dark bg-dark fixed-top',
      a: [
        {
          class: 'navbar-brand',
          value: 'Logo'
        }
      ],
      button: [
        {
          class: 'navbar-toggler',
          type: 'button',
          span: [
            {
              class: 'navbar-toggler-icon',
            }
          ]
        }
      ]
    }
  ]
}

Examples :

We have added 2 exmaples one for Bootstrap and other for Materialize :

$ git clone this repository / download zip
$ cd example
$ voila start

View your static webpage server on http://localhost:(port)