Git Product home page Git Product logo

appjs's Introduction

AppJS

AppJS is an SDK to develop desktop applications using Node.js melded with Chromium. With AppJS you can develop desktop tools and applications using the same libraries and knowledge used to build websites. You get all the following in one package:

  • JS, HTML5, CSS, SVG, WebGL provided by Chromium
  • mature http/https servers and client APIs - Node
  • filesystem, dns, cryptography, subprocesses, OS APIs - Node
  • sandboxed code execution environements virtual machines - Node
  • tools for exposing native C++ bindings to JavaScript--APIs for authoring and the tools for compiling - Node


AppJS is under heavy development. Expect many API changes and things to break.

Zero Configuration Quick Start

The below packages include everything needed to get started with AppJS, including Node.js, all dependencies, binaries, and a launcher ready to go out of the box. 1.) Extract to a folder. 2.) Double click on launch. 3.) Hello World.

AppJS 0.0.13 Complete Distributables:

  • Windows (32 bit) -> launch.exe
  • Linux (64 bit) -> launch.sh
  • Mac (32 bit) -> launch.sh

Hello World

Node Install

Be forewarned: due to the complex dependencies of AppJS, installation via npm is difficult and error prone.

You need to have node v0.8.x and node-gyp installed. After installing node, use the following command to install node-gyp:

$ sudo npm install node-gyp -g

Please take a look at node-gyp repository and make sure you have all required packages.

Platform build requirements:

  • Mac OS X: Currently 32bit node only, $ node -e "console.log(process.arch)" -> ia32
  • Linux: $ sudo apt-get install libgtk2.0-dev
  • Windows: Windows SDK, DirectX SDK, and Visual C++ 2010

Usage Overview

There is a complete example in the examples folder.

var appjs = require('appjs');

var window;

// Initialize appjs.
var app = appjs.init();

// Called when page load finishes.
app.on("ready",function(){
    console.log("Event Ready called");

    // Runs a script in browser context.
    window.runInBrowser(function(){
        var body = document.body;
        body.style.color="#f60";
    });

  // Show created window ( see below )
  window.show();
});

// Routing:

// you can use a static router:
// app.use(app.staticRouter('./public'));

// or you can handle requests manually:
app.get("/",function(req,res,next){
  res.send("\
    <html>\
        <head><title>Hello World</title></head>\
        <body>Hello World</body>\
    </html>\
  ")
});

// Creates a new window. Its invisible until window.show() get called.
// http://appjs/ is a special url. It is home for your application!
window = app.createWindow("http://appjs/",{autoResize:false});

License

( The MIT License )

Copyright (c) 2012 Morteza Milani and other AppJS contributors

See the LICENSE file for details.

appjs's People

Contributors

milani avatar farhadi avatar

Stargazers

Nicolas Embleton avatar

Watchers

Nicolas Embleton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.