@nodevu/parsefiles
v0.0.3
Published
parse the files identifiers from Node.js
Downloads
3,768
Readme
@nodevu/parsefiles
a utility to parse Node.js's files information from distribution metadata into something more useful.
Usage
const parsefiles = require('@nodevu/parsefiles')
const version = '17.6.0'
const files = ["aix-ppc64","headers","linux-arm64","linux-armv7l","linux-ppc64le","linux-s390x","linux-x64","osx-arm64-tar","osx-x64-pkg","osx-x64-tar","src","win-x64-7z","win-x64-exe","win-x64-msi","win-x64-zip","win-x86-7z","win-x86-exe","win-x86-msi","win-x86-zip"]
files.forEach(file => {
const data = parsefiles(file, version)
console.log(data)
})
The Data
When run, @nodevu/parsefiles
will return an object with the following properties:
id
(String) - the identifier (file) that was passed in. Examples:aix-ppc64
,linux-x64
,osx-x64-pkg
,osx-arm64-tar
,win-x64-zip
,src
,headers
.files
(Array) - an array of filenames that should exist for the release. There are often more than one.type
(String) - indicates either the operating system, or that the files are source/headers, parsed out of theid
. Examples:linux
,macos
,windows
,aix
,sunos
,source
,headers
.architecture
(String) - a string that represents the architecture of the files. Examples:x86
,x64
,arm64
,armv7l
,armv6l
,power
,z