-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathis_demo.js
More file actions
36 lines (30 loc) · 1.14 KB
/
is_demo.js
File metadata and controls
36 lines (30 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
///////////////////////////////////////////////////////////////////////////////
//
// StringEncrypt WebApi interface usage example.
//
// In this example we will verify our activation code status.
//
// Version : v1.0.0
// Language : JavaScript
// Author : Bartosz Wójcik
// Project page : https://www.stringencrypt.com
// Web page : https://www.pelock.com
//
///////////////////////////////////////////////////////////////////////////////
import { StringEncrypt } from 'stringencrypt';
const stringEncrypt = new StringEncrypt('');
const result = await stringEncrypt.isDemo();
if (result === false) {
console.log('Cannot connect to the API.');
process.exit(1);
}
if (result.demo) {
console.log('DEMO mode');
} else {
console.log('FULL mode');
console.log(`Credits left: ${String(result.credits_left ?? '')}`);
}
console.log(`Label max length: ${String(result.label_limit ?? '')}`);
console.log(`String max length: ${String(result.string_limit ?? '')}`);
console.log(`Bytes max length: ${String(result.bytes_limit ?? '')}`);
console.log(`cmd_min / cmd_max: ${String(result.cmd_min ?? '')} / ${String(result.cmd_max ?? '')}`);