Perhaps 'procfs' dependency isn't really needed?
( procfs
can certainly do a lot, but we only need rather little )
IMHO, this should suffice, to get all the parsing info needed under linux:
(already with heavy filtering as in PR 124)
const getMount = (mountId, _parentID, _deviceNo, root, mountPoint, mountOptions, _fields, _mountSource, superOptions, blob) => (
{
mountId,
// parentID,
// deviceNo,
root,
mountPoint,
mountOptions: mountOptions.split(','),
// fields,
// mountSource,
superOptions: superOptions.split(','),
blob
})
const mounts = fs.readFileSync('/proc/self/mountinfo', 'utf-8')
mounts.split(/\n/)
.filter(l => l.length > 0) // filter empty line at end
.map((m) => getMount(...m.split(' ')))
.filter((m) =>
!/^\/(snap|run|sys|proc|dev)($|\/)/.test(m.mountPoint) &&
!['mqueue', 'tmpfs'].includes(m.superOptions) &&
!m.superOptions.includes('mqueue') &&
!m.superOptions.includes('tmpfs') &&
!m.mountOptions.includes('ro')
)
.map((l) =>
info(l))
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too