Socket
Book a DemoInstallSign in
Socket

yofz

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
Package was removed
Sorry, it seems this package was removed from the registry

yofz

A node module aimed to ease the creation of directories and templates inside Yeoman.

unpublished
latest
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Yofz - Yeoman File System Helper

This is a node module which ease the process for a developer to create the directories and templates needed for a Yeoman Generator. This module enables you to create a hierarchical structure of Directories and Templates (Plates).

Installation

npm install --save yofz

Coding

Once installed require it. This will create a new instance of Yofz

var Yofz = require('Yofz')

A Yofz instance will require two things: A root directory and a reference to the Yeoman generator being used. This can either be done when requiring the module:

module.exports = generator.Base.extend( {
  initializing: function() {
    require('Yofz')(rootDir, this)
  }
});

Or by using the .setGenerator(..) and .setRoot(..) methods:

var Yofz = require('Yofz')
Yofz.setGenerator(this)
Yofz.setRoot(rootDir)

Creating Directories

var dir = Yofz.Directory(name[, opts])
No.TypeDescription
1StringThe name of the directory.
2JSONConfiguration.

Inside the Configuration object one can enter the following:

No.NameTypeDescription
1childrenArray or AssetChild or children assets.
2writeBooleanTrue if the template file should be written, false otherwise.

Creating Templates

var index = Yofz.Plate(name[,opts])
No.TypeDescription
1StringThe name of the template.
2JSONConfiguration.

Inside the Configuration object one can enter the following:

No.NameTypeDescription
1contextJSONTemplate context object.
2writeBooleanTrue if the template file should be written, false otherwise.

Appending Files and Directories inside other Directories

var root      = Yofz.Directory('root')
var dist      = Yofz.Directory('dist')
var index     = Yofz.Plate('index.js', { 'context': {'title': 'Yofz'}
                                       , 'write': true
                                       })
dist.contains(index)
root.contains(root)

Build It

Yofz.build()

Keywords

Yeoman

FAQs

Package last updated on 21 Mar 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