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

durandal-scaffold

v0.4.1

Published

Scaffolding utility for Durandal SPA Framework

Downloads

8

Readme

Durandal Scaffolding Node CLI

Durandal-scaffold is a Node.JS CLI tool to help you get started with the Durandal SPA Framework. Besides scaffolding new Viewmodels, Views and Spec files it supports as well the setup of your frontend app structure. It is used via a guided approach prompting for actions or via shortcuts (see below)

Features

Create the ds.config.json file which is used for specifying the appropriate paths
ds setup
Create default folder structure

Besides the creation of the basic folder structure the scaffolding will also create a basic app main.js entry file, which is already wired up properly with RequireJS configs.

ds prepare
----------

| app
| ----> viewmodels
| ----> views
| ----> main.js
| test
| ----> specs
Install the Durandal SPA Framework and Twitter Bootstrap v3 via bower
ds install
Create a VM + Spec file
ds vm [vmname]
Create a VM + View + Spec file
ds vmfull [vmname]
Create the default Karma configuration file

This will setup the Karma Runner config file and test-main runner, preset to Jasmine 2.0 and RequireJS, including the path setup for the DurandalJS Framework and it's dependencies.

ds karma-config

Additionally you'd need to install Karma and it's necessary dependencies. The easiest method is to add following entries to your package.json file

"devDependencies": {
  "karma": "~0.12.16",
  "karma-jasmine": "~0.2.0",
  "karma-phantomjs-launcher": "~0.1.4",
  "requirejs": "~2.1.14",
  "karma-requirejs": "~0.2.2"
}

This will setup Karma with Jasmine 2.0 as well as PhantomJS as the headless browser for running the tests. Karma-requirejs finally helps working with the RequireJS environment of the DurandalJS Framework.

To run Karma in continous testing mode (watching file changes while development) simple run following command in the terminal from your apps base folder.

karma start

For additional information on how to tweak the karma config or add additional features like code coverage please visit the Karma homepage

Run guided mode

After you've run ds setup you can continue all the other commands via the guided cli mode instead of remembering all the parameters.

ds
----------

[?] Choose a command: (Use arrow keys)
> Create a VM/Spec
  Create a VM/View/Spec
  Prepare the project structure
  Install Durandal via Bower
  Create the default Karma configuration and test-main file
  Exit

Quick Example

  1. Create the folder for your new application [demo]
  2. cd demo
  3. ds setup
  4. ds prepare
  5. ds install
  6. have fun ...

More information

For more information about Durandal please consult the Durandal online docs at:

http://durandaljs.com/docs.html