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

ether

v0.0.9

Published

Simple scaffolding tool.

Downloads

1,014

Readme

Ether

Status

Build Status

Description

Ether is a simple tool to make scaffolding easy, and fun in a programmatic way.

Installation

[sudo] npm i ether

Ether file

Example

'use strict';
var path = require('path');
var ether = require('ether');
var nodeModule = ether({
  questions: [{
    type: 'input',
    name: 'name',
    message: 'Whats the name of the module?'
  }, {
    type: 'input',
    name: 'version',
    message: 'Whats the version of the module?',
    default: '0.0.1'
  }, {
    type: 'input',
    name: 'entryPoint',
    message: 'What the entry point of the module?',
    default: 'index.js',
  }, {
    type: 'input',
    name: 'author',
    message: 'Who is the author of the module?'
  }, {
    type: '',
    name: 'public',
    message: 'This module is public?',
    default: true
  }],
  tree: [
    ['{{name}}'],
    ['{{name}}/bin'],
    ['{{name}}/lib'],
    ['{{name}}/examples'],
    ['{{name}}/test']
  ],
});

nodeModule.task('questions', function (doneHandler) {
  nodeModule.run('prompt', [nodeModule.get('questions'), doneHandler]);
});

nodeModule.task('build', function () {
  var self = this;

  self.get('tree').map(function (item) {
    self.run('mkdir', item);
  });

  return self;
});

nodeModule.task('seed', function (cb) {
  var self = this;

  self
    .run('download', [
      'https://gist.github.com/kaiquewdev/9087288/raw/b7d70fc5e3aad9e04b6549bc4239f38f1149af5c/ether-package.json',
      './{{name}}/package.json'),
      cb
    ]);

  return self;
});

nodeModule.make('default', function () {
  var self = this;

  function doneHandler() {
    nodeModule.run('build');
    nodeModule.run('seed', [function () {
      console.log('Download was completed and template too.');
    }]);
  }
  nodeModule.run('questions', [doneHandler]);

  return self;
});

module.exports = exports = nodeModule;

Install the cli

[sudo] npm i -g ether

Use the cli tool, to run scaffolding, to generate new applications.

Use the '--install' option

ether -i etherfile.js

The install option use the etherfile.js or and module installed.

To run make tasks registered in the etherfile use

ether -u [etherfile] -m [task-name]

Global scaffolding

[sudo] npm i -g ether-node-module

and

ether -i ether-node-module

or

ether -i node_modules/ether-node-module

Or using this way to install one scaffolding from npm, and run this scaffolding app.

API

Instance

var app = ether({
  name: 'Example'
});

Instantiation of the scaffolding.

Get and Set

app.get('name');

and

app.set('version', '0.0.1');

Get and Set, modify the context of the instance.

Task

app.task('create-app-structure', function () {
  app.run('mkdir', ['app/'])
     .run('mkdir', ['app/models'])
     .run('mkdir', ['app/views'])
     .run('mkdir', ['app/controllers']);
});

using the task method you can create new methods to reuse in the instance, of the current scaffolding app.

Default tasks

Mkdir
app.run('mkdir', [destiny]);

On the destiny dir, this task create an new directory

Copy

app.run('copy', [source, destiny]);

That task make a copy of an file

Template

app.run('template', [source, destiny]);

This task make a copy and replace variables from context of the instance of the scaffolding, to another new file.

Prompt

app.run('prompt', [[{type:'input', name: 'name', message: 'Whats the name of that application?'}]]);

To put variables using the interactive mode in the context of the instance, use this method.

Download

app.run('download', [url, destiny, callback]);

To make download of an file and put in the project replacing, variables.

Run

app.run('create-app-structure');

This method run tasks previously defined.

Make

app.make('default', function () {
  app.run('create-app-structure');
});

The make method can register a bunch of tasks.

Make run

app.make('default');

And run a bunch of tasks.

Note

[WIP]

Created by Kaique da Silva [email protected]