Completed
Push — master ( ee7956...a1d8a9 )
by Sand
01:08
created

examples/schedule-files.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 54
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 0
wmc 1
nc 1
mnd 0
bc 1
fnc 1
dl 0
loc 54
rs 10
bpm 1
cpm 1
noi 1
c 1
b 0
f 1
1
2
'use strict';
3
4
const Sandcage = require('..');
5
6
const sandcage = new Sandcage('[YOUR SANDCAGE API KEY]');
7
const payload = {
8
  jobs: [
9
    {
10
      url: 'http://cdn.sandcage.com/p/a/img/logo.jpg',
11
      tasks: [
12
        {
13
          actions: 'save'
14
        },
15
        {
16
          actions: 'resize',
17
          filename: 'hello_world.jpg',
18
          width: 200
19
        },
20
        {
21
          actions: 'crop',
22
          coords: '10,10,50,50'
23
        },
24
        {
25
          'reference_id': '123456789',
26
          actions: 'rotate',
27
          degrees: 90
28
        },
29
        {
30
          actions: 'cover',
31
          width: 60,
32
          height: 60,
33
          cover: 'middle,center'
34
        }
35
      ]
36
    },
37
    {
38
      url: 'http://cdn.sandcage.com/p/a/img/header_404.png',
39
      tasks: [
40
        {
41
          actions: 'resize',
42
          height: 30
43
        }
44
      ]
45
    }
46
  ]
47
};
48
49
const callbackUrl = '';
50
51
sandcage
52
  .scheduleFiles(payload, callbackUrl)
53
  .then((result) => {
54
    console.log(result);
55
  });