Coder Social home page Coder Social logo

command-validator's Introduction

command-validator

Version Downloads Build Status Open Issues Dependency Status License

A module for validating a Screwdriver Command file

YAML

# example.yaml
namespace: git
name: clone
version: '1.1'
description: SD Command for git clone with habitat.
maintainer: [email protected]
format: habitat
habitat:
    mode: remote
    package: core/git/2.14.1
    command:  git clone

Usage

$ npm install screwdriver-command-validator

Validate in Node.js:

const fs = require('fs');  // standard fs module
const validator = require('screwdriver-command-validator');

// The "example.yaml" is the YAML described above
validator(fs.readFileSync('example.yaml'))
    .then((commandData) => {
        console.log(commandData);
    });

Output of the console.log():

config: {
    description: 'SD Command for git clone with habitat.',
    maintainer: '[email protected]',
    name: 'git',
    namespace: 'clone',
    version: '1.0',
    format: 'habitat',
    habitat: {
        mode: 'remote',
        package: 'core/git/2.14.1',
        command: 'git clone'
    }
}

Validate in CLI:

$ ./node_modules/.bin/command-validate -h

  Usage: validate [options]


  Options:

    -j, --json         output with JSON
    -f, --file [name]  screwdriver command file (default: ./sd-command.yaml)
    -h, --help         output usage information

$ ./node_modules/.bin/command-validate -j
{"valid":true}

Testing

npm test

License

Code licensed under the BSD 3-Clause license. See LICENSE file for terms.

command-validator's People

Contributors

tk3fftk avatar klu909 avatar tkyi avatar pritamstyz4ever avatar d2lam avatar minzcmu avatar philipjscott avatar vnugopal avatar

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.