Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ash

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ash

Ash is a framework for the bohemian web developer.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
2
Weekly downloads
 
Created
Source

Ash welcomes you

Build Status

Ash is a framework for the bohemian web developer. Executed on Node.js or run in the client, Ash provides an intuitive, unrestrictive boudoir in which creators can frolic with and fondly tease the interwebs. The truths and understandings upheld in the body of code known as Ash are;

  • MVA that executes both on client & server
  • Code, Convention, Configuration
I'm still smoking this one

The project is still in its early stages and is currently showing signs of emergent behavior. Once it chills out I'll add the obligatory "Getting Started" documentation here.

Developer Preview

Install Ash;

npm install ash -g

Create a file called helloworld.js in an empty directory;

define({
    index: function (api) {
        api.done("Hello world.");
    }
});

In the same directory start Ash;

ash start

Open http://localhost:3000/?module=helloworld&method=index in a browser.

To run the same code 100% in the browser you need to add one file name init.js with the content;

require(["lib/adapters/dom"]);

Then start Ash in webapp mode;

ash webapp

Open http://localhost:3000/?module=helloworld&method=index in a browser.

The Idea

An Immutable Request Object

request = {
    module: "", // a relative path to a module
    method: "", // the function to call on the module
    inputs: {} // a map of values to be made avaliable to the function 
};

A Functional Response Object

response = {
    done: function (data, meta){
        // Adapter to runtime
    },
    flush: function (data, meta) {
        // Adapter to runtime
    }
};

A Single Dispatcher Function

dispatcher = function (request, response) {
    // Map request object to function (api)
};

A Runtime Agnostic Api Object

api = {
    done: response.done,
    flush: response.flush,
    dispatch: dispatcher,
    use: { /* helpers */ }
};

Function Collections

Defined using the Asynchronous Module Definition API, Function Collections are a grouping mechanism for organizing your code. Each function defined in the collection must take exactly one argument, the value of which is a Runtime Agnostic Api Object.

define({
    index: function (api) {
        api.done("Hello world.");
    }
});

Helpers

Defined using the Asynchronous Module Definition API, helpers are attached to a Runtime Agnostic Api Object when specified in Function Collections. Helpers can implement the function init(), which if present will be called immediately after the helper is created.

define({
	init: function (request, response, api) {
		// Store for use later
	},
	func: function () {
		// Add functions
	}
});

Helpers are specified in Function Collections by the use of a helpers attribute whose value is an array.

define({
	helpers: ["config"],
    index: function (api) {
		var module = api.use.config.get("module");
        api.done("This is module: " + module);
    }
});

-- http://progmofo.com/

FAQs

Package last updated on 03 Sep 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc