Small library to parse file listings (e.g., ls, dir) into JavaScript objects. Currently at v1.1.3, last released in 2018 with a fix for MS-DOS folder names containing numbers. It supports Unix and DOS/Windows formats automatically. The library is stable but in maintenance mode; no new features are expected. Compared to alternatives, it is minimal and has no dependencies.
npm install parse-listingNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a Unix 'ls -la' formatted string into objects, logging name, type, and size for each entry.
Always wrap in try-catch for parseEntry or check input validity before calling parseEntries.
Use a library like moment.js to parse the raw date string if needed; check entry.time for NaN.
Consider switching to 'ftp-parse-listing' or writing a custom parser if you need active maintenance.
Run 'npm install parse-listing' and ensure require('parse-listing') is correct.Use const Parser = require('parse-listing'); instead of import.Ensure callback is a function: Parser.parseEntries(str, function(err, entries) { ... });