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

clean-blacksmith

v1.0.5

Published

Create your service domain wih clean code principals.

Downloads

3

Readme

Generate a clean-architecture skeleton project easy and fast!.

Clean Blacksmith CircleCI

Synopsis

Clean Blacksmith will help you create the base of your domain, so you can only focus on the implementation! just tell the CleanBlacksmith where you want to create your files and give him a blueprint(only JSON format supported at the moment) and he will take care of the rest.

Installation

As a node dependency

npm install --save-dev clean-blacksmith

Or as a CLI tool

npm install [-g] clean-blacksmith

Usage

You have two options of usage:

As a node module

After instalation, just require clean-blacksmith and then give a command and details as parameters:

var cleanBlacksmith = require('clean-blacksmith');

var command = 'forge';
var details = { target: '/some/url', blueprint: '/some/url/blueprint.json' };

cleanBlacksmith(command, details)
  .then(result => { console.log('success') })
  .catch(error => { console.log('ups!') });

The blacksmith will give you some feedback through log messages to see what has been created:

Sample console output:
createdDomainFiles: '<TARGET PATH>/domain/entities/Sword.js'
createdDomainFiles: '<TARGET PATH>/domain/entities/index.js'
createdDomainFiles: '<TARGET PATH>/domain/interactors/swordInteractor.js'
createdDomainFiles: '<TARGET PATH>/domain/interactors/index.js'
createdDomainFiles: '<TARGET PATH>/domain/stores/swordStore.js'
createdDomainFiles: '<TARGET PATH>/domain/stores/index.js'
createdDomainFiles: '<TARGET PATH>/domain/useCases/forgeSword.js'
createdDomainFiles: '<TARGET PATH>/domain/useCases/index.js'
createdDomainFiles: '<TARGET PATH>/domain/domain/index.js'
forge: Finished forging! Happy coding :)

As CLI tool

If you like to use your terminal to create your domain, this module offers as well a CLI tool called vulcan. Vulcan recieves a command and some parameters in order to create your service domain.

Example:

vulcan <COMMAND> --target <PATH> --blueprint <PATH>

vulcan forge --target "/path-to-project/" --blueprint "/path-to-blueprint/blueprint.json"

If you need to learn what is the current available commands, you can display the help:

vulcan --help [-h]

Blueprint file

The blueprint file defines the way our domain is constructed, this is required in order to know how layers are defined. The file at the moment only supports JSON format but it will be target later to support more formats.

NOTE: This project contains two full blueprint examples definitions in the /examples folder.

for example:
{
  "entities": [
    {
      "name": "Sword",
      "props": ["type","weight"]
    }
  ],
  "interactors": [
    {
      "name": "swordInteractor",
      "dependencies": ["entities", "stores"],
      "functions": {
        "requestMaterials": { "args": [] },
        "meltSilver": { "args": [], "isAsync": true }
      }
    }
  ],
  "stores": [...],
  "useCases": [
    {
      "name": "forgeKatana",
      "dependencies": ["swordInteractor"],
      "args": ["swordMaterials"]
    }
  ]
}

Further plans

  • Inlude more command options: ammend, enhance, destroy.
  • Add a way to create the blueprint in a more friendly way. UI will be ideal