std/README.md

33 lines
717 B
Markdown
Raw Normal View History

2023-01-28 19:16:48 +01:00
# STD
Standard module for NodeJS / TypeScript
2022-11-02 19:50:58 +01:00
```js
2023-01-28 21:32:18 +01:00
import { cin } from '@thundernetworkrad/std';
2023-01-24 22:50:10 +01:00
cin('Question').then((response) => {
2022-11-02 19:50:58 +01:00
console.log(response)
})
2023-01-24 17:19:35 +01:00
```
```js
2023-01-28 21:32:18 +01:00
import { createCout } from '@thundernetworkrad/std';
2023-01-24 17:19:35 +01:00
2023-01-28 19:16:48 +01:00
let ccout = new createCout(0, true); // debugLevel, logs enabled (file) (like using log() )
2023-01-24 17:19:35 +01:00
let cout = ccout.cout;
2023-01-28 19:16:48 +01:00
cout('test', 0) // console.log day, time and the string, if the number is >= to the debugLevel
```
```js
2023-01-28 21:32:18 +01:00
import { log } from '@thundernetworkrad/std';
2023-01-28 19:16:48 +01:00
log('test') // create a file at the first log, add the string to the log
```
```js
2023-01-28 21:32:18 +01:00
import { getTime } from '@thundernetworkrad/std';
2023-01-28 19:16:48 +01:00
let time = getTime() // return { year, month, day, hours, minutes, seconds }
2023-01-24 17:19:35 +01:00
```