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 🙏

© 2025 – Pkg Stats / Ryan Hefner

fskeleton

v0.2.3

Published

Easy and fast library for generate file and folder structures in your projects with a very small effort.

Downloads

9

Readme

Fast Skeleton

NPM Package Version Downloads Build Status Code Climate Inline docs

Easy and fast library for generate file and folder structures in your projects with a very small effort.

Features:

  • Small footprint library.
  • You can use interfaces like a prompt with skeleton-prompt.

Getting Started

Skeleton works with generators. A generator are a directory with files, folders and templates that will be created in some location of your file system.

The main file of generator is known as "manifest". Manifest defines all actions that will be done. For example: create, copy o generate files from predefined templates. In this directory we have files and folder structure that contains the templates or files that we will work with it.

Skeleton is a very simplified concept of yeoman generators. I try to avoid the complexity of this project to put in your hands a very useful library.

Installation

npm install fskeleton --save

Creating a generator

Only create a directory and put inside it a file called manifest.js:

/home/me/fskeleton/sk/
└── manifest.js

Note: you can name this file with other name, but you need to remember it when you instantiate the generator.

You are free to define the internal folder and file structure, like where locate templates, assets and other types of files. My recommendation is follow some methodology. You can study and follow our test fixtures. For example:

/home/me/fskeleton/sk/
├── manifest.js
├── templates
|    ├── README.tpl
|    └── component.tpl
└── assets
     ├── asset1.jpg
     ├── asset2.jpg
     └── subdir
         ├── asset3.txt
         └── asset4.jpg

Creating the manifest.js file

First of all, create a manifest.js. This file tells Skeleton how deal with files inside generator. The scaffold property must be defined.

// /home/me/fkeleton/sk/manifest.js
module.exports = {

  // Default data for all scaffold
  defaultData: {
    name: 'unnmaed'
  },

  scaffold: {
    // Creates a folder with rwx permissions (UNIX)
    'app/components' : {
      action : 'folder',
      mode   : 0777
    },
    // Generate a file from template
    'app/README.md': {
       action : 'template',
       path   : 'templates/README.tpl',
       // Data for template: name will be overriden
       data   : { name: 'Testing' }
    },
    // Copy "as it is" the assets/ to app/assets. Including subdirs.
    'app/assets/': {
      action : 'copy',
      path   : 'assets/'
    }
  }

}

Using before trigger

You can add to your manifest a before function to change scaffold object dynamically. For example:

module.exports = {

  // ......

  // If we pass data argument with components property, we will add
  // dynamically new path and configurations to scaffold object
  before: function(scope, data) {

    var self = this;

    if(typeof data.components !== "undefined") {

      data.components.forEach(function(component) {

        self.scaffold['app/components/' + component + '.txt'] = {
          action : 'template',
          path   : 'templates/component.tpl',
          data   : { component: component}
        };

      });
    }

  }

  // ......
}

Use

There are two ways for deploy structures:

Traditional way:

You define all scope object at instantiation time.

var Skeleton = require('fskeleton');

// Optional argument and object. It will create a data object for each path in
// scaffold object. Take care! if some data object is defined, it will be merged
var data = {
  components: ['component1', 'component2']
};

var sk = new Skeleton({
  generator : '/home/me/fskeleton/sk',  // Where is the generator
  dest      : '/tmp/',                  // Where will be created the structure
}, data);

// Create structure in file system
sk.create()
  .then(function() {
    // Do things when finish...
  })
;  

Shortcut way:

You can use this way for skeleton-prompt and ask scope variables like dest or for complete data object.

var Skeleton = require('fskeleton');

var data = {
  components: ['component1', 'component2']
};

// You can use '/home/me/fskeleton/sk/othermanifes.js', by default it search
// manifest.js
var sk = new Skeleton('/home/me/fskeleton/sk', data);

sk.scope('dest', '/tmp/');

// Create structure in file system
sk.create()
  .then(function() {
    // Do things when finish...
  })
;  

Remember that sk.create() returns a promise object. I use bluebird library.

License

MIT License © David Pérez Terol