npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-laxarjs

v1.5.3

Published

Yeoman generator for LaxarJS applications and artifacts

Downloads

6

Readme

LaxarJS generator

A simple way to create LaxarJS applications and artifacts

Installation

First you have to install the required npm modules for yeoman and install the package with the LaxarJS generator:

npm install -g yo bower grunt-cli generator-laxarjs

Alternatively you can install the packages locally in the application directory. Take a look below to the section "Local Installation" .

Generators

The Yeoman generator laxarjs comes up with the main generator for scaffolding an application and three sub generators for widgets, activities and controls.

Available generators:

  • laxarjs
  • laxarjs:widget
  • laxarjs:activity
  • laxarjs:control

Application

To scaffold a new LaxarJS application, create a directory and run the generator:

mkdir my-application
cd my-application
yo laxarjs

After answering several questions, the generator creates the bare-bones application scaffolding for you. Now you can fetch your project's dependencies using npm install and start the application development server by running grunt laxar-develop.

Option for the App-Generator

The app generator has one option for a custom banner. You can pass the path to a file including your custom banner as an option. The files the generator creates will have this banner.

mkdir my-application
cd my-application
yo laxarjs --banner=my-custom-banner.txt

The banner will be saved in the Yeoman configuration file (.yo-rc.json) and will be used by the sub-generators.

Sub-Generators

The sub-generators expect a Yeoman configuration file .yo-rc.json in the root directory of the application. If you created your application using the Yeoman generator as described above, a Yeoman configuration file was already created for you.

If the application has no Yeoman configuration file, just create one by running:

echo {} > .yo-rc.json

Widget

To generate the scaffold for a LaxarJS widget use the following command:

yo laxarjs:widget

The generator creates the new widget in a directory named like the widget. If the current directory is the root directory of the application, the generator places the new widget into the default directory for widgets, includes/widgets. Otherwise, the widget scaffolding is created within the current directory.

Activity

To generate the scaffolding for a LaxarJS activity use either the command

yo laxarjs:activity

or use the widget generator with the option activity:

yo laxarjs:widget --activity

The generator creates the new activity in a directory named like the activity, just as described above for widgets.

Control

To generate the scaffolding for a LaxarJS control use the following command:

yo laxarjs:control

The generator creates the new control in a directory named by the control. If the current directory is the root directory of the application, the generator places the new widget into the default directory for controls, includes/controls. Otherwise, a new directory with the scaffolding is created in the current directory.

Arguments and Options for Sub-Generators

Each of the three sub-generators accepts the name for the artifact as an argument, the destination path as an option and an option for a custom header. The following examples are for the widget generator but the others behave accordingly.

You can pass the name for a new widget as an argument from the command line:

yo laxarjs:widget my-widget

In this case the generator creates the scaffold in the directory includes/widgets/my-widget independently from the working directory.

Using the option directory, it is possible to change the destination. Using this command, the generator creates the files in a directory named by the new widget in the directory includes/widgets/destination:

yo laxarjs:widget --directory=includes/widgets/destination

It is possible to set the directory option and pass the name as argument:

yo laxarjs:widget my-widget --directory=includes/my-app

Using this pattern, the full path can be specified when running the generator. The command above creates the new widget in the directory includes/my-app/my-widget.

If you want a custom banner for the files the generator creates, you can pass the path to a file including your banner as option:

yo laxarjs:widget my-widget --banner=my-custom-banner.txt

Local Installation

Alternatively to the global installation of the npm modules you can install the packages locally in the application directory:

mkdir my-application
cd my-application
npm install yo bower grunt-cli generator-laxarjs

Create a simple npm configuration file for bootstrapping:

echo '{ "scripts": { "yo": "yo" } }' > package.json

The LaxarJS generator will ask if it should overwrite the package.json and you should agree.

To run Yeoman and the LaxarJS generator use npm run yo laxarjs instead of yo laxarjs.