fakefile

2018-12-07 admin

fakefile是什么

什么是fakefile,Install a Makefile into your node projects that acts as an npm run-script wrapper

fakefile使用教程帮助文档

Fakefile

A Universal Makefile for JavaScript that proxies to your npm scripts.

How

After installing, you can type mak<TAB><TAB> for autocompletion. Fakefile then quickly enumerates any npm scripts in your package.json and presents these. It does this at runtime, so it won’t need any maintenance as your project changes its npm scripts.

Why

This gets us the best of both worlds. Codify your tasks in a system (npm scripts) that won’t be obsolete within the year, that’s straightforward to people on Windows (they can ignore the Makefile and use npm run), and unix folks alike. Profit from instant autocomplete. In any repo I maintain, no matter the language, make <something> gets me what I want without thinking twice.

I wrote a blog post that goes into more detail why this makes for a great JavaScript task running environment.

Use

Run e.g. make test and the command is passed onto npm run test that should do the lower-level plumbing.

Makefiles can’t handle : characters well so it will offer npm run build:production to you as make build-production.

Install

You could save Fakefile’s Makefile into your project root, and that’s that.

Alternatively, you can use the npm installer:

npm install fakefile --save-dev --save-exact 

This will save a Makefile into your project root.

If the installer detects a Makefile it does not recognize by its sha1 hash, it will warn you instead of overwriting it. This gives you a chance to port any existing Makefile logic to npm scripts, after which you can safely remove your original Makefile and rerun the installation, this time successfully installing Fakefile. The installer is happy to overwrite known sha1s, so that we can upgrade should the need arise.

Authors

Sponsoring

Flattr donate button

License

Copyright © 2016 Kevin van Zonneveld, http://kvz.io Licensed under MIT: http://kvz.io/licenses/LICENSE-MIT

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-47540.html

文章标题:fakefile

回到顶部