Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/installed-pods
Extract installed Pod information from the output of a CocoaPods installation command
https://github.com/shinnn/installed-pods
Last synced: 27 days ago
JSON representation
Extract installed Pod information from the output of a CocoaPods installation command
- Host: GitHub
- URL: https://github.com/shinnn/installed-pods
- Owner: shinnn
- License: mit
- Created: 2015-10-29T08:23:29.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-29T08:55:08.000Z (about 9 years ago)
- Last Synced: 2024-04-15T00:04:31.282Z (7 months ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# installed-pods
[![NPM version](https://img.shields.io/npm/v/installed-pods.svg)](https://www.npmjs.com/package/installed-pods)
[![Build Status](https://travis-ci.org/shinnn/installed-pods.svg?branch=master)](https://travis-ci.org/shinnn/installed-pods)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/installed-pods.svg)](https://coveralls.io/r/shinnn/installed-pods)
[![devDependency Status](https://david-dm.org/shinnn/installed-pods.svg)](https://david-dm.org/shinnn/installed-pods)
[![devDependency Status](https://david-dm.org/shinnn/installed-pods/dev-status.svg)](https://david-dm.org/shinnn/installed-pods#info=devDependencies)Extract installed [Pod](https://cocoapods.org/) information from the output of a [CocoaPods installation command](https://guides.cocoapods.org/terminal/commands.html#group_installation)
```javascript
const installedPods = require('installed-pods');const stdout = `
Using colored 1.2
Installing rouge 1.10.1
Installing xcjobs 0.2.2 (was 0.1.2)
`;installedPods(stdout)
/* => [
{
name: 'rouge',
current: '1.10.1'
},
{
name: 'xcjobs',
current: '0.2.2',
previous: '0.1.2'
}
]
*/
```## Installation
[Use npm.](https://docs.npmjs.com/cli/install)
```
npm install installed-pods
```## API
### installedPods(*str*)
*str*: `String`
Return: `Array` of plain objectsIt parses a string of the installation log generated with CocoaPods installation commands (e.g. [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install)) and returns an array of objects that shows which Pod was installed. Each of the object is in the form:
```javascript
{
name: "Pod name", // String
current: "installed version", // String
previous: "previous version" // String, or `undefined` if the Pod was newly installed
}
```It automatically strips [ANSI escape codes](https://wikipedia.org/wiki/ANSI_escape_code) before parsing a string.
```javascript
const installedPods = ('installed-pods');installedPods('\u001b[32mInstalling rouge 1.10.1\u001b[39m');
//=> [{name: 'rouge', current: '1.10.1'}]
```## License
Copyright (c) 2015 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).