Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const os = require('os');
- const allInfo = Object.keys(os);
- const isOsFunction = (item) => typeof os[item] === "function";
- const getinfo = (info) => ({[info]: os[info]()});
- const logItem = (item) => {
- console.log(JSON.stringify(item,null,2));
- return item;
- }
- console.log("Show functions result:");
- allInfo.filter(isOsFunction).map(getinfo).map(logItem);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement