Git Product home page Git Product logo

jp's Introduction

Yasmim [WIP]

Build Status via Travis CI

yasmim is a golang library that helps to implement chain of responsibility design pattern.

Installation

If you are not using an IDE with go modules support, install it with go:

$ go get -u github.com/tsouza/yasmim

Import it into your code

import "github.com/tsouza/yasmim"

Quick Start

Register a command and run it

package main

import (
	"github.com/tsouza/yasmim"
	"github.com/tsouza/yasmim/pkg/command"
	"github.com/tsouza/yasmim/pkg/log"
)

const Name = "my_first_command"

func main() {
  	yasmim.Register(func(define command.Define) {
  		define.Command("my_first_command").
  			Handler(func(_ command.Runtime, _ *log.Logger, _, _ interface{}) error {
                // my_first_command Handler
            })
  	})

    _ = yasmim.New().Run("my_first_command", nil, nil)
}

License

Code and documentation released under The MIT License (MIT).

jp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jp's Issues

Support for CLI args

Currently and modules ~/.jp/* require hard coding of file names, which sometimes works well in current directory, but doesn't work well if files are from different locations. Would be cool if you could do:

$jp analytics/slice/dice -file1 folder1/file.x -file2 folder2/file.x 

Where dice.js understands how to handle that

Error: process.stdout cannot be closed.

Mac OS X 10.11.6
node v7.4.0

jp index/shards gives output, but ends with this error

Error: process.stdout cannot be closed.
    at WriteStream.stdout.destroy.stdout.destroySoon (internal/process/stdio.js:12:18)
    at maybeDestroy (net.js:451:12)
    at WriteStream.Socket.end (net.js:440:5)
    at Object.complete (/usr/local/lib/node_modules/json-processing/dist/lib/output.js:94:20)
    at Object.wrappedComplete (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/Subscriber.js:222:76)
    at SafeSubscriber.__tryOrUnsub (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/Subscriber.js:239:16)
    at SafeSubscriber.complete (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/Subscriber.js:224:26)
    at Subscriber._complete (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/Subscriber.js:133:26)
    at Subscriber.complete (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/Subscriber.js:115:18)
    at MapSubscriber.Subscriber._complete (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/Subscriber.js:133:26)
    at MapSubscriber.Subscriber.complete (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/Subscriber.js:115:18)
    at MergeMapSubscriber.notifyComplete (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/operators/mergeMap.js:167:30)
    at InnerSubscriber._complete (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/InnerSubscriber.js:30:21)
    at InnerSubscriber.Subscriber.complete (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/Subscriber.js:115:18)
    at Object.complete (/usr/local/lib/node_modules/json-processing/dist/lib/extensions/rxjs/groupJoin.js:48:39)
    at Object.wrappedComplete (/usr/local/lib/node_modules/json-processing/node_modules/rxjs/Subscriber.js:222:76)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.