stf-ipareader
v1.0.0
Published
An IPA parser for stf same as adbkit-apkreader
Downloads
9
Readme
stf-ipareader
stf-ipareader provides a Node.js API for extracting information from iOS IPA files. For example, it allows you to read the Info.plist
of an existing IPA file.
Requirements
- Node.js 4.x or newer. Older versions are not supported.
Getting started
Install via NPM:
npm install --save stf-ipareader
Examples
Read the Info.plist
of an IPA
const util = require('util')
const IpaReader = require('stf-ipareader')
IpaReader.open('hello.ipa')
.then(reader => reader.readManifest())
.then(manifest => console.log(util.inspect(manifest, { depth: null })))
API
IpaReader
IpaReader.MANIFEST
A convenience constant with the value '.app/Info.plist'
. Can use useful with other API methods in certain circumstances.
IpaReader.open(file)
Alternate syntax to manually creating an ApkReader instance. Currently, only files are supported, but support for streams might be added at some point.
Note that currently this method cannot reject as the file is opened lazily, but this may change in the future and therefore returns a Promise for fewer future compatibility issues. On a related node, calling the constructor directly is still possible, but discouraged.
- file The path to the IPA file.
- Returns: A
Promise
that resolves with anIpaReader
instance.
reader.readManifest()
Reads and parses the Info.plist
file inside the APK and returns a simplified object representation of it.
- Returns: A
Promise
that resolves with a JavaScriptObject
representation of the manifest. See example output below. Rejects on error (e.g. if parsing was unsuccessful).
{ versionCode: 1,
versionName: '1.0',
package: 'com.example.hello'
}