std/README.md

35 lines
777 B
Markdown
Raw Normal View History

2023-01-28 19:16:48 +01:00
# STD
Standard module for NodeJS / TypeScript
Note: TypeScript support is in testing
2022-11-02 19:50:58 +01:00
```js
2023-01-24 22:50:10 +01:00
const { cin } = require('@thundernetworkrad/std');
cin('Question').then((response) => {
2022-11-02 19:50:58 +01:00
console.log(response)
})
2023-01-24 17:19:35 +01:00
```
```js
const { createCout } = require('@thundernetworkrad/std');
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
const { log } = require('@thundernetworkrad/std');
log('test') // create a file at the first log, add the string to the log
```
```js
const { getTime } = require('@thundernetworkrad/std');
let time = getTime() // return { year, month, day, hours, minutes, seconds }
2023-01-24 17:19:35 +01:00
```