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

hanging-gardens

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hanging-gardens

A JavaScript project structure for NoRIA webpages.

  • 2.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

Hanging Gardens

A JavaScript project structure for NoRIA webpages.

Philosophy

A lot of effort is put in making JavaScript based RIA development easier. This is a good thing for RIAs. But NonRIA development, development of regular webpages, still feels like we are stuck in 1995. Sure, we have great libraries like jQuery and MooTools but we still treat our .js files like a bunch of hacks. I don't like hacks so I decided to make something that encourages us, developers, to start taking JavaScript coding serious. This was the birth of Hanging Gardens. Hanging Gardens provides an infrastructure to load js code (like you would load Ruby or PHP code) and it turns many small (and well structured) js files into one (often huge) file. This file can then be further optimized by Googles Closure Compiler or JSMin.

How does it work

A new Hanging Gardens project contains four directories (behaviours, helpers, widgets and lib) and a package.json file. Here is an explanation of what should go in each directory or file.

  • behaviours: contains files with code that makes a webpage or parts thereof behave in a certain way. Think of these as controllers (as in MVC).
  • helpers: contains files with code that you need to use often in many different files.
  • widgets: contains files with code for reusable components, like a sortable table for example.
  • lib: contains files with code that doesn't fit in any of the other directories.
  • package.json: is a CommonJS/Package file which is compatible with the npm package manager.

Take a look at the examples for more information.

Installation

Make sure you have Node.js and NPM installed (on OSX: brew install npm).

npm install hanging-gardens -g

Next, make sure you have Yuicompressor installed

brew install yuicompressor

Building the example

This will build a package.js file.

git clone git://github.com/fd/hanging_gardens.js.git
cd hanging_gardens.js
garden examples/hello-world-js/package.json
# or
garden examples/hello-world-coffee/package.json

The package.js file

The package.js file specifies the project dependencies and how the project files should be processed.

Format

{ "type"    : "application"           // this enables the extra directories
, "main"    : "./behaviours/index.js" // the main behaviour

// the dependecies
, "dependencies" :
  { "jquery": ">= 1.4.3"
  }
}

How to enable JSLint

In your package.json file add this option:

"lint": true

How to enable YUI Compressor

In your package.json file add this option:

"compression": "yui"

How to use Coffee Script

Just create a .coffee file.

Keywords

FAQs

Package last updated on 07 May 2015

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