Giter Site home page Giter Site logo

fecs's Introduction

FECS

FECS 是基于 Node.js 的前端代码风格工具。

Build Status Build Status NPM version Coverage Status Dependencies DevDependencies

安装

    $ [sudo] npm install fecs -g

使用

    fecs
    fecs -v
    fecs check --help
    fecs format --help

更多参数见 wiki: CLI

API

fecs.leadName

设置或获取控制台输出信息前的名称,默认值为 fecs

var fecs = require('fecs');
fecs.leadName = 'edp';
...

fecs.getOptions(Array argv)

获取经 minimist 解释后的命令行参数对象,可用于 fecs.checkfecs.format 方法。

var options = fecs.getOptions(process.argv.slice(2));

console.log(options.command); // 'check'
...

fecs.check(Object options[, Function done])

检查文件或输入流的代码规范。

// 设置检查的文件路径
options._ = ['/path/to/check'];

// 或者设置为 stream
// options.stream = yourReadableStream;

// 设置文件类型
// options.type = 'js,css';


/**
 * callback after check finish
 *
 * @param {boolean} success true as all files ok, or false.
 * @param {Object[]} errors data for check result.
 */
function done(success, errors) {
    // blablabla
}

fecs.check(options, done);

fecs.format(Object options)

格式化、修复文件或输入流的代码。

fecs.check(options);

工具支持

常见问题

更多信息请访问 https://github.com/ecomfe/fecs/wiki

fecs's People

Contributors

chriswong avatar ielgnaw avatar junmer avatar leeight avatar marxjiao avatar oxund avatar

Watchers

 avatar  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.