{"_id":"@delfi-ch/linux-os-info-esmodule","_rev":"3-f668bae98e7768840064ff607f7d7c05","name":"@delfi-ch/linux-os-info-esmodule","dist-tags":{"latest":"2.0.3"},"versions":{"2.0.1":{"name":"@delfi-ch/linux-os-info-esmodule","version":"2.0.1","keywords":["linux","release","info","os","distribution","/etc/os-release"],"author":{"name":"Bruce A. MacNaughton","email":"bmacnaughton@gmail.com"},"license":"MIT","_id":"@delfi-ch/linux-os-info-esmodule@2.0.1","maintainers":[{"name":"delfi-ch","email":"delfi@delfi.dev"}],"contributors":[{"url":"http://www.samuelcarreira.com","name":"Samuel Carreira","email":"samuelcarreira@outlook.com"},{"name":"Iván Sánchez Ortega","email":"ivan@sanchezortega.es"},{"name":"Delfi-CH","email":"delfi@delfi.dev"}],"homepage":"https://github.com/Delfi-CH/linux-os-info-esmodule#readme","bugs":{"url":"https://github.com/Delfi-CH/linux-os-info-esmodule/issues"},"dist":{"shasum":"c7a844acd91cd080dee3b17fcd82de5e7326b5aa","tarball":"https://registry.npmjs.org/@delfi-ch/linux-os-info-esmodule/-/linux-os-info-esmodule-2.0.1.tgz","fileCount":8,"integrity":"sha512-vBc4av4BdnUtS51xRfZry6uG0U36CobPePFFwM6YosbU4Mm0gkMf4WRdiTR+pvNktCZdaQnMRycchs1aShS9Mg==","signatures":[{"sig":"MEYCIQDr32GlgBBJSz4L9OmyXedXBakiZJZFDmNNtEVPrbXqcQIhAJLJhYJmNwrZ7g3Rgaiv6UX8iD+sAO9ZAGm96TSwQm03","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20406},"main":"index.cjs","type":"module","exports":{".":{"import":"./index.js","require":"./index.cjs"}},"gitHead":"08033b2f099db5307668f7f32f480e21679691d9","scripts":{"test":"mocha"},"_npmUser":{"name":"delfi-ch","email":"delfi@delfi.dev"},"repository":{"url":"git+https://github.com/Delfi-CH/linux-os-info-esmodule.git","type":"git"},"_npmVersion":"11.7.0","description":"Get Linux release info (distribution name, version, arch, release, etc.) from '/etc/os-release' file and from native os module. On Windows and Macs it returns only node os module info (platform, hostname, release and arch)","directories":{},"_nodeVersion":"22.20.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0"},"_npmOperationalInternal":{"tmp":"tmp/linux-os-info-esmodule_2.0.1_1778149217508_0.3060994902645735","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@delfi-ch/linux-os-info-esmodule","version":"2.0.2","keywords":["linux","release","info","os","distribution","/etc/os-release"],"author":{"name":"Bruce A. MacNaughton","email":"bmacnaughton@gmail.com"},"license":"MIT","_id":"@delfi-ch/linux-os-info-esmodule@2.0.2","maintainers":[{"name":"delfi-ch","email":"delfi@delfi.dev"}],"contributors":[{"url":"http://www.samuelcarreira.com","name":"Samuel Carreira","email":"samuelcarreira@outlook.com"},{"name":"Iván Sánchez Ortega","email":"ivan@sanchezortega.es"},{"name":"Delfi-CH","email":"delfi@delfi.dev"}],"homepage":"https://github.com/Delfi-CH/linux-os-info-esmodule#readme","bugs":{"url":"https://github.com/Delfi-CH/linux-os-info-esmodule/issues"},"dist":{"shasum":"4677dd540003d868d8e40e1290aa9bbf52b00269","tarball":"https://registry.npmjs.org/@delfi-ch/linux-os-info-esmodule/-/linux-os-info-esmodule-2.0.2.tgz","fileCount":8,"integrity":"sha512-e7Ak+WKxfehZAdG2sjYZPckhDpqp3uLBCIciT5dOMR+Z60ZWbtX9UWOJDUXgJF7NE3m6TN0iFj3irFbaON3JpQ==","signatures":[{"sig":"MEUCIEEPEORU28WuLjrva7L8eFwswIhKb5OMne9LKhDG01BKAiEA7uNWQrc5i3+L0Aom1QB3bvvk0iTy5FUaIaEMsBzg31g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20531},"main":"index.cjs","type":"module","exports":{".":{"import":"./index.js","require":"./index.cjs"}},"gitHead":"cd0a43035b5c6be80c295e2b9910a4f17a49f0f3","scripts":{"test":"mocha"},"_npmUser":{"name":"delfi-ch","email":"delfi@delfi.dev"},"repository":{"url":"git+https://github.com/Delfi-CH/linux-os-info-esmodule.git","type":"git"},"_npmVersion":"11.7.0","description":"Get Linux release info (distribution name, version, arch, release, etc.) from '/etc/os-release' file and from native os module. On Windows and Macs it returns only node os module info (platform, hostname, release and arch)","directories":{},"_nodeVersion":"22.20.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0"},"_npmOperationalInternal":{"tmp":"tmp/linux-os-info-esmodule_2.0.2_1778149503251_0.34197984567966855","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@delfi-ch/linux-os-info-esmodule","version":"2.0.3","description":"Get Linux release info (distribution name, version, arch, release, etc.) from '/etc/os-release' file and from native os module. On Windows and Macs it returns only node os module info (platform, hostname, release and arch)","main":"index.cjs","type":"module","exports":{".":{"import":"./index.js","require":"./index.cjs"}},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Delfi-CH/linux-os-info-esmodule.git"},"keywords":["linux","release","info","os","distribution","/etc/os-release"],"author":{"name":"Bruce A. MacNaughton","email":"bmacnaughton@gmail.com"},"contributors":[{"name":"Samuel Carreira","email":"samuelcarreira@outlook.com","url":"http://www.samuelcarreira.com"},{"name":"Iván Sánchez Ortega","email":"ivan@sanchezortega.es"},{"name":"Delfi-CH","email":"delfi@delfi.dev"}],"license":"MIT","bugs":{"url":"https://github.com/Delfi-CH/linux-os-info-esmodule/issues"},"homepage":"https://github.com/Delfi-CH/linux-os-info-esmodule#readme","devDependencies":{"chai":"^4.2.0"},"gitHead":"77f3710f4cf6aad3cc1b4226635771648317060c","_id":"@delfi-ch/linux-os-info-esmodule@2.0.3","_nodeVersion":"26.0.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-pG/PqqTr42QDKydDHYj8dlFJTGpoEu4Rqjf5VHOBI8ztbdNaDluZNdwTMjrbbUCZHFzEyZJAJyAWbhoBDs98wQ==","shasum":"53eafb7df6fac57b80d9df97f025d8a3cd83cd95","tarball":"https://registry.npmjs.org/@delfi-ch/linux-os-info-esmodule/-/linux-os-info-esmodule-2.0.3.tgz","fileCount":8,"unpackedSize":20534,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDekAvrq3ymtQfh9K03V+X8oHLivOwLVavnyhLwFr1+FAiAj5ohyRDB4TmRyr3pcTtjoiZAle5xD9iFdm6dT3KjP2w=="}]},"_npmUser":{"name":"delfi-ch","email":"delfi@delfi.dev"},"directories":{},"maintainers":[{"name":"delfi-ch","email":"delfi@delfi.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/linux-os-info-esmodule_2.0.3_1778674326661_0.4335309810331103"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T10:20:17.435Z","modified":"2026-05-13T12:12:07.000Z","2.0.1":"2026-05-07T10:20:17.644Z","2.0.2":"2026-05-07T10:25:03.408Z","2.0.3":"2026-05-13T12:12:06.886Z"},"bugs":{"url":"https://github.com/Delfi-CH/linux-os-info-esmodule/issues"},"author":{"name":"Bruce A. MacNaughton","email":"bmacnaughton@gmail.com"},"license":"MIT","homepage":"https://github.com/Delfi-CH/linux-os-info-esmodule#readme","keywords":["linux","release","info","os","distribution","/etc/os-release"],"repository":{"type":"git","url":"git+https://github.com/Delfi-CH/linux-os-info-esmodule.git"},"description":"Get Linux release info (distribution name, version, arch, release, etc.) from '/etc/os-release' file and from native os module. On Windows and Macs it returns only node os module info (platform, hostname, release and arch)","contributors":[{"name":"Samuel Carreira","email":"samuelcarreira@outlook.com","url":"http://www.samuelcarreira.com"},{"name":"Iván Sánchez Ortega","email":"ivan@sanchezortega.es"},{"name":"Delfi-CH","email":"delfi@delfi.dev"}],"maintainers":[{"name":"delfi-ch","email":"delfi@delfi.dev"}],"readme":"linux-os-info\n=================\n\nThis is a fork of [bmacnaughton/linux-os-info](https://github.com/bmacnaughton/linux-os-info), which adds ESModule support.\n\nGet OS release info from the node `os` module and, for Linux releases, from the `'/etc/os-release'`, `/usr/lib/os-release`, or `/etc/alpine-release` file. If none of those files exists it returns only the node `os` module info (platform, hostname, release, and arch)\n\n### Highlights\n* Lightweight without any dependencies (only native Node modules)\n* Synchronous, callback, or promise - choose how you want to use it.\n\n\n## Installation\n\n    npm install --save @delfi-ch/linux-os-info-esmodule\n\n## Usage\n\n```js\nimport linuxOsInfo from '@delfi-ch/linux-os-info-esmodule'\n\n// the example presumes running some flavor of linux.\n\n// synchronous - use an options argument with {mode: 'sync'}\nvar result = linuxOsInfo({mode: 'sync'})\nconsole.log(`You are using ${result.pretty_name} on a ${result.arch} machine`)\n\n// asynchronous - pass a function as the mode\nlinuxOsInfo({mode: function (err, result) {\n  console.log(`You are using ${result.pretty_name} on a ${result.arch} machine`)\n}})\n\n// promise - no arguments or no mode specified\nlinuxOsInfo()\n  .then(result => {\n    console.log(`You are using ${result.pretty_name} on a ${result.arch} machine`)\n  })\n  .catch(err => console.error(`Error reading OS release info: ${err}`))\n\n```\nOn my machine all three versions output:\n```\nYou are using Arch Linux on a x64 machine\n```\n\nThe API completely changed from version 1. The single, optional argument is an options object.\n\nv1: `osInfo({synchronous: true})`\nv2: `osInfo({mode: 'sync'})`\n\nv1: `osInfo(function (err, data) {...})`\nv2: `osInfo({mode: function (err, data) (...)})`\n\nv2 *NEVER* returns errors (unless there is an internal error). The data object returned now has a file property which holds the file that was read (one of those in the list above). If no file was read it holds an instance of `Error`. Because node's `os` information is always returned the file data is considered optional.\n\n\n#### Sample outputs\n\nThese example outputs are courtesy of Samuel Carreira. His (linux-release-info)[https://github.com/samuelcarreira/linux-release-info] combined with my wanting a synchronous version were the inspiration for this package.\n\nv2 note: the `file` property is not shown in these examples.\n\n**Linux**\n```\n{ type: 'Linux',\n  platform: 'linux',\n  hostname: 'VirtualBoxLINUX',\n  arch: 'x64',\n  release: '4.13.0-32-generic',\n  name: 'Ubuntu',\n  version: '17.10 (Artful Aardvark)',\n  id: 'ubuntu',\n  id_like: 'debian',\n  pretty_name: 'Ubuntu 17.10',\n  version_id: '17.10',\n  home_url: 'https://www.ubuntu.com/',\n  support_url: 'https://help.ubuntu.com/',\n  bug_report_url: 'https://bugs.launchpad.net/ubuntu/',\n  privacy_policy_url: 'https://www.ubuntu.com/legal/terms-and-policies/privacy-policy',\n  version_codename: 'artful',\n  ubuntu_codename: 'artful' }\n```\n**Linux (Raspberry Pi)**\n```\n{ type: 'Linux',\n  platform: 'linux',\n  hostname: 'raspberrypi',\n  arch: 'arm',\n  release: '4.9.59-v7+',\n  pretty_name: 'Raspbian GNU/Linux 9 (stretch)',\n  name: 'Raspbian GNU/Linux',\n  version_id: '9',\n  version: '9 (stretch)',\n  id: 'raspbian',\n  id_like: 'debian',\n  home_url: 'http://www.raspbian.org/',\n  support_url: 'http://www.raspbian.org/RaspbianForums',\n  bug_report_url: 'http://www.raspbian.org/RaspbianBugs' }\n```\n**Linux (Fedora)**\n```\n{ type: 'Linux',\n  platform: 'linux',\n  hostname: 'localhost-live',\n  arch: 'x64',\n  release: '4.13.9-300.fc27.x86_64',\n  name: 'Fedora',\n  version: '27 (Workstation Edition)',\n  id: 'fedora',\n  version_id: '27',\n  pretty_name: 'Fedora 27 (Workstation Edition)',\n  ansi_color: '0;34',\n  cpe_name: 'cpe:/o:fedoraproject:fedora:27',\n  home_url: 'https://fedoraproject.org/',\n  support_url: 'https://fedoraproject.org/wiki/Communicating_and_getting_help',\n  bug_report_url: 'https://bugzilla.redhat.com/',\n  redhat_bugzilla_product: 'Fedora',\n  redhat_bugzilla_product_version: '27',\n  redhat_support_product: 'Fedora',\n  redhat_support_product_version: '27',\n  privacy_policy_url: 'https://fedoraproject.org/wiki/Legal:PrivacyPolicy',\n  variant: 'Workstation Edition',\n  variant_id: 'workstation' }\n```\n**Windows**\n```\n{ type: 'Windows_NT',\n  platform: 'win32',\n  hostname: 'MYPC',\n  arch: 'x64',\n  release: '10.0.16299' }\n```\n**macOS**\n```\n{ type: 'Darwin',\n  platform: 'darwin',\n  hostname: 'Macbook-Air.home',\n  arch: 'x64',\n  release: '16.0.0' }\n```\n\n#### Windows and Macs?\nIf you want info about Windows or Mac releases, you can try the following modules from sindresorhus:\nhttps://www.npmjs.com/package/win-release\nor\nhttps://www.npmjs.com/package/macos-release\n\n\n## License\nLicensed under MIT\n","readmeFilename":"README.md"}