console-app/AppTest.js

30 lines
937 B
JavaScript
Raw Normal View History

2020-05-15 16:53:45 +02:00
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of console-app which is released under MIT.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
2020-05-09 21:33:16 +02:00
// @ts-nocheck
2020-05-09 19:51:43 +02:00
/* eslint-disable no-console */
'use strict';
2020-05-09 21:33:16 +02:00
// eslint-disable-next-line node/no-missing-require, id-match
2020-05-09 19:51:43 +02:00
const { InteractiveOptions } = require ('./dist/lib/index.js');
(async () => {
const reader = new InteractiveOptions ([
2020-05-09 21:30:37 +02:00
{ name: 'str', type: 'string', env: 'TEST_STR' },
{ name: 'bool', type: 'boolean', env: 'TEST_BOOL' },
{ name: 'num', type: 'number', env: 'TEST_NUM' },
2020-05-18 11:03:49 +02:00
{ name: 'arr', type: 'array', env: 'TEST_ARR' },
{ name: 'fld', type: 'folder', env: 'TEST_FOLDER' }
2020-05-28 18:54:34 +02:00
], {
exit_on_interrupt: true,
configs: [ 'test.json' ],
error_callback: console.log
});
2020-05-09 19:51:43 +02:00
await reader.parse ();
console.log (reader.serialize (true));
}) ();