UNPKG

nodulator

Version:

Complete NodeJS Framework for Restfull APIs

93 lines (92 loc) 7.23 kB
{ "_args": [ [ { "name": "nodulator-assets", "raw": "nodulator-assets@file:./src/Modules/Nodulator-Assets", "rawSpec": "file:./src/Modules/Nodulator-Assets", "scope": null, "spec": "/home/fgreiner/prog/js/Nodulator/src/Modules/Nodulator-Assets", "type": "directory" }, "/home/fgreiner/prog/js/Nodulator" ] ], "_from": "src/Modules/Nodulator-Assets", "_id": "nodulator-assets@0.0.10", "_inCache": true, "_installable": true, "_location": "/nodulator-assets", "_phantomChildren": { "character-parser": "1.2.1", "constantinople": "3.0.2", "cookie-signature": "1.0.6", "mkdirp": "0.5.1", "transformers": "2.1.0", "void-elements": "1.0.0", "with": "4.0.3" }, "_requested": { "name": "nodulator-assets", "raw": "nodulator-assets@file:./src/Modules/Nodulator-Assets", "rawSpec": "file:./src/Modules/Nodulator-Assets", "scope": null, "spec": "/home/fgreiner/prog/js/Nodulator/src/Modules/Nodulator-Assets", "type": "directory" }, "_requiredBy": [ "/" ], "_resolved": "file:src/Modules/Nodulator-Assets", "_shasum": "4a2186b423fa6391b4fd1c3a77e9b0acd2ce850b", "_shrinkwrap": null, "_spec": "nodulator-assets@file:./src/Modules/Nodulator-Assets", "_where": "/home/fgreiner/prog/js/Nodulator", "author": { "email": "greine_f@epitech.eu", "name": "Champii" }, "bugs": { "url": "https://github.com/Champii/Nodulator-Assets/issues" }, "dependencies": { "coffee-middleware": "~0.3.0", "coffee-script": "~1.9.0", "connect-cachify": "~0.0.17", "cookie-parser": "~1.3.3", "grunt": "0.4.5", "grunt-contrib-coffee": "0.13.0", "grunt-contrib-cssmin": "0.14.0", "grunt-contrib-uglify": "0.11.0", "jade": "~1.8.1", "livescript": "^1.4.0", "livescript-middleware": "^1.0.1", "underscore": "~1.7.0" }, "description": "Assets management for Nodulator", "devDependencies": { "mocha": "~2.0.1" }, "directories": { "test": "test" }, "homepage": "https://github.com/Champii/Nodulator-Assets#readme", "keywords": [ "Nodulator", "Assets" ], "license": "GPLv2", "main": "index.js", "name": "nodulator-assets", "optionalDependencies": {}, "readme": "Nodulator-Assets\n================\n\nAssets and views automatic management system for [Nodulator](https://github.com/Champii/Nodulator)\n\nMaster : [![Build Status](https://travis-ci.org/Champii/Nodulator-Assets.svg?branch=master)](https://travis-ci.org/Champii/Nodulator)\n\nDevelop: [![Build Status](https://travis-ci.org/Champii/Nodulator-Assets.svg?branch=develop)](https://travis-ci.org/Champii/Nodulator)\n\nNPM: [![npm version](https://badge.fury.io/js/nodulator-assets.svg)](http://badge.fury.io/js/nodulator-assets)\n\nReleased under [GPLv2](https://github.com/Champii/Nodulator-Assets/blob/master/LICENSE.txt)\n\n## Concept\n\nProvides ability to `Nodulator` to render views and auto-load assets in following folders:\n- `Nodulator.config.js`: array for js (or coffee) files\n- `Nodulator.config.css`: array for css files\n- `Nodulator.config.viewRoot`: path for index.jade\n\n___\n## Features\n\n- Automatic js and css assets loading\n- Provides methods for modules to add folders to assets management\n- Provides basic view system (only '`Nodulator.config.viewRoot`/index.jade' for the moment)\n- Add a `Nodulator.Run()` method to be called last for view rendering\n- Add a `Nodulator.ExtendBeforeRun()` and `Nodulator.ExtendAfterRun()` method for modules to add instructions at the begining of `Run()` or just before `Render()`\n- Add a `Nodulator.ExtendBeforeRender()` and `Nodulator.ExtendAfterRender()` method for modules to add instructions at the begining of `Render()` or just before the actual `res.render()`\n- CoffeeScript automatic compilation on fly\n- Jade automatic compilation on fly (no other engines yet)\n- Can manage multiple sites and assets collections\n\n___\n## JumpTo\n\n- [Installation](#installation)\n- [Basics](#basics)\n- [Project Generation](#project-generation)\n- [Module Hacking](#module-hacking)\n- [TODO](#todo)\n- [Changelog](#changelog)\n\n___\n## Installation\n\nYou can automaticaly install `Nodulator` and `Nodulator-Assets` by running\n\n```\n$> sudo npm install -g Nodulator\n$> Nodulator install assets\n```\n\nOr you can just run `npm` :\n\n```\n$> npm install nodulator nodulator-assets\n```\n\n___\n## Basics\n\n```coffeescript\nNodulator = require 'nodulator'\nAssets = require 'nodulator-assets'\n\n# Default config, can be omited\nNodulator.Config\n assets:\n app: # You can add another entry like 'app' to handle another site\n path: '/client'\n js: ['/client/public/js/', '/client/']\n css: ['/client/public/css/']\n\n viewRoot: 'client'\n engine: 'jade' #FIXME: no other possible engine\n\nNodulator.Use Assets\n\n# New method, to be called last for rendering\nNodulator.Run()\n```\n\nIn `index.jade`, you must always call `| !{nodulator()}` at the end of the file.\n\nIt's there that all `Nodulator-Assets` magic stuff occur, and the only call you'll ever have to do in views.\n\n___\n## Project Generation\n\nSee [Nodulator's project generation](https://github.com/Champii/Nodulator#project-generation)\n\nWhen calling `$> Nodulator init`, it will automaticaly create following structure if non-existant:\n\n```\nclient\n├── index.jade\n└── public\n ├── css\n ├── img\n └── js\n```\n\n___\n## Module Hacking\n\nThe module is stored in `Nodulator.assets` and provides following methods :\n\n```coffeescript\n # Add folders given in list to assets list\n Nodulator.assets.AddFolder (list) ->\n\n # Add folders given in list to assets list, the recursive way\n Nodulator.assets.AddFolderRec (list) ->\n```\n\nExemple of asset list : (paths are relative to project root)\n\n```coffeescript\n list =\n '/js/app.js': ['/client/folder1/']\n '/css/app.css': ['/client/public/css/']\n```\n\n___\n## TODO\n\n- Test suite\n- Image (and other static assets) management\n- Split assets between `head` and `body` tags\n\n___\n## Changelog\n\nXX/XX/XX: Current (not released yet)\n - Added a parameter to view nodulator() function to get a specific set of assets\n - Added multiple sites modification\n\n12/02/15: v0.0.9\n - Added fake tests\n - Updated README\n\n03/01/15: v0.0.8\n - Added `Nodulator.ExtendBeforeRender()` and `Nodulator.ExtendAfterRender()` to precisely extend render process.\n\n02/01/15: v0.0.7\n - Updated README\n\n02/01/15: v0.0.6\n - Changed `Nodulator.ExtendRunProcess` into `Nodulator.ExtendBeforeRun`\n - Added `Nodulator.ExtendAfterRun`\n - That fixes cachify_js bug if another render is processed\n\n02/01/15: v0.0.5\n - Added index.jade file generation\n - Changed the way folders are configurated\n - Improved README\n - Files are automaticaly loaded by `!{nodulator()}` call\n - Added automatic compilation of views\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/Champii/Nodulator-Assets.git" }, "scripts": { "test": "mocha --compilers coffee:coffee-script/register test" }, "version": "0.0.10" }