1 | # antfarm
|
2 |
|
3 | Antfarm is a simple automation framework that aims to make file automation robust and scalable. 🐜
|
4 |
|
5 | [![Build Status](https://travis-ci.org/dominickp/antfarm.svg?branch=master)](https://travis-ci.org/dominickp/antfarm)
|
6 | [![Coverage Status](https://coveralls.io/repos/github/dominickp/antfarm/badge.svg?branch=master)](https://coveralls.io/github/dominickp/antfarm?branch=master)
|
7 | [![npm version](https://badge.fury.io/js/antfarm.svg)](https://badge.fury.io/js/antfarm)
|
8 | [![Dependancy Status](https://david-dm.org/dominickp/antfarm.svg)](https://david-dm.org/dominickp/antfarm)
|
9 | [![Gitter](https://badges.gitter.im/dominickp/antfarm.svg)](https://gitter.im/open-automation/Lobby)
|
10 |
|
11 | ## Usage
|
12 |
|
13 | ```sh
|
14 | $ npm install antfarm
|
15 | ```
|
16 |
|
17 | ```js
|
18 | const Antfarm = require('antfarm'),
|
19 | af = new Antfarm();
|
20 |
|
21 | let hotfolder_a = af.createFolderNest("/var/hotfolders/a");
|
22 | let pdf_folder = af.createFolderNest("/var/out/pdf");
|
23 | let other_folder = af.createFolderNest("/var/out/others");
|
24 |
|
25 | let tunnel = af.createTunnel("Simple pdf sorting workflow");
|
26 |
|
27 | tunnel.watch(hotfolder_a);
|
28 |
|
29 | tunnel.run((job, nest) => {
|
30 | if(job.getExtension() == "pdf"){
|
31 | job.move(pdf_folder);
|
32 | } else {
|
33 | job.move(other_folder);
|
34 | }
|
35 | });
|
36 |
|
37 | ```
|
38 |
|
39 | ## Wiki
|
40 | https://github.com/dominickp/antfarm/wiki
|
41 |
|
42 | ## API Reference
|
43 | https://dominickp.github.io/antfarm
|