Skip to content

kfatehi/apple-system-profiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apple-system-profiler

wrapper around apple's system_profiler that parses the output

usage

const {systemProfiler: asp} = require('./index.js')

// Grab graphics, hardware, and memory info
// and parse them out as a JavaScript object

asp({
  dataTypes: [
    'SPDisplaysDataType',
    'SPHardwareDataType',
    'SPMemoryDataType'
  ]
  /*
  Other options (with defaults):
    detailLevel: 'mini', // mini|basic|full
    cwd: undefined,
    maxBuffer: Infinity,
    normalize: true // Set to `false` to get raw, untransformed JSON data
   */
}, (err, out) => {
  if ( err ) throw err;
  console.log(out);
});

There is also listDataTypes method which resolves to the system's available dataTypes.

const jsonArray = await listDataTypes();

see test.js

About

wrapper around apple's system_profiler that parses the output

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published