https://github.com/osfunapps/os-logger
This module contains nodejs log operations
https://github.com/osfunapps/os-logger
Last synced: 3 months ago
JSON representation
This module contains nodejs log operations
- Host: GitHub
- URL: https://github.com/osfunapps/os-logger
- Owner: osfunapps
- Created: 2019-12-20T19:44:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-07T14:44:50.000Z (over 5 years ago)
- Last Synced: 2025-06-06T04:37:54.394Z (about 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Introduction
------------
This module contains nodejs print operations
## Installation
Install via npm:
npm i os-logger
## Usage
Require logger:
```js
var logger = require("os-logger")
```
## Functions and signatures:
```js
/**
* Will print a warning message
*/
warning: function (txt) {
print(WARNING, txt)
},
/**
* Will print a bold message
*/
bold: function (txt) {
print(BOLD, txt)
},
/**
* Will print an underline message
*/
underline: function (txt) {
print(UNDERLINE, txt)
},
/**
* Will print a failed message
*/
failure: function (txt) {
print(FAILURE, txt)
},
/**
* Will print a success message
*/
success: function (txt) {
print(SUCCESS, txt)
},
/**
* Will print an info message
*/
info: function (txt) {
print(INFO, txt)
},
/**
* Will request an input from the user
*/
inputRequest: function (text) {
return new Promise((resolve, reject) => {
const {stdin, stdout} = process;
stdin.resume();
stdout.write(REQUEST + text + "\n");
stdin.on('data', data => {
resolve(data.toString().trim());
stdin.destroy()
});
stdin.on('error', err => reject(err));
stdin.on('end', function(){
console.log("closed!")
});
})
}
```
And more...
## Links -> see more tools
* [os-tools-npm](https://github.com/osfunapps/os-tools-npm) -> This module contains fundamental functions to implement in an npm project
* [os-file-handler-npm](https://github.com/osfunapps/os-file-handler-npm) -> This module contains fundamental files manipulation functions to implement in an npm project
* [os-file-stream-handler-npm](https://github.com/osfunapps/os-file-stream-handler-npm) -> This module contains read/write and more advanced operations on files
* [os-xml-handler-npm](https://github.com/osfunapps/os-xml-handler-npm) -> This module will build, read and manipulate an xml file. Other handy stuff is also available, like search for specific nodes
[GitHub - osapps](https://github.com/osfunapps)
## Licence