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

websemble

v7.0.3

Published

Desktop application framework based on web technology.

Downloads

17

Readme

websemble

Desktop application MVC framework

it offers the following features:

  • Based on web technology. Built on top of Electron
  • File system storage service with a REST API
  • Web component support
  • i18n support with i18next
  • View template support with Handlebars

Installation

cd myproject
npm install websemble

Getting started

First let's create a view to display, the Index view.

mkdir -p frontend/component/view/Index

In the index folder create a Controller.js file and a View.html file. The content should be:

function IndexController( view, scope ){
 this.super( view, scope );
}

module.exports = IndexController;
<template class="main">
 <h1>Hello World!</h1>
</template>

<script>
   (function(window, document, undefined) {
     require( "websemble" ).frontend.createComponent( 'view-index' );
   })(window, document);
</script>

Next we will create the App component.

mkdir -p frontend/component/core/App

As with the view component, we have to create a Controller and a View file for the App.

function AppController( view, scope ){
  this.super( view, scope );
  scope.resolveAppReady();
}

module.exports = AppController;

The resoleveAppReady funtion call lets the other components know that the app has finished initializing. You may want to call this method after assets are loaded, for example.

<template class="main">
  <view-index></view-index>
</template>

<script>
    (function(window, document, undefined) {
      require( "websemble" ).frontend.createComponent( 'core-app' );
    })(window, document);
</script>

Next create the app.js file in the root with the following content:

var Websemble = require('websemble');
var app = new Websemble.backend.App();

Make sure that the value for the main attribute in the package.json configuration file is "app.js".

The last file we need to create is the index.html in the root.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>websemble</title>
    <link rel="import" href="frontend/component/core/App/View.html" />
    <link rel="import" href="frontend/component/view/Index/View.html" />
    <style>
      core-app {
        display:block;
      }
    </style>
  </head>
  <body>
    <core-app></core-app>
  </body>
</html>

You will need electron to run your application:

npm install electron-prebuilt

To run your application, just type:

./node_modules/.bin/electron .

Dig deeper

We have developed a very handy tool to generate boiler plate code for your websemble application. Checkout the Yeoman [websemble generator] (https://github.com/cybersettler/generator-websemble).

For information about the motivation and architecture behind websemble, have a look at the [project's wiki] (https://github.com/cybersettler/websemble/wiki).

To learn about making desktop applications with html5, head to the Electron website. This is the framework on top of which websemble is built.