Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ZenHubIO/chromepet
A NodeJS module for reporting new version of Chrome extension being published on Chrome Web Store
https://github.com/ZenHubIO/chromepet
Last synced: 26 days ago
JSON representation
A NodeJS module for reporting new version of Chrome extension being published on Chrome Web Store
- Host: GitHub
- URL: https://github.com/ZenHubIO/chromepet
- Owner: ZenHubIO
- License: mit
- Created: 2014-11-08T05:55:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-09T19:54:08.000Z (about 10 years ago)
- Last Synced: 2024-11-10T19:45:49.516Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 159 KB
- Stars: 31
- Watchers: 20
- Forks: 23
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-WebExtensions - chromepet - Get notified when your new version has been published. (Tools)
README
ChromePet
=========A node.js command line app for reporting new extension version published on Chrome Web Store
## Quick Start
```
npm install -g chromepet$ chromepet -u https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd -v 1.0.3
```#### Result
```
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
...
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
New version 1.0.3 is published! UserDownloads:9,823.
Total seconds: 1.132
```## Module API
```
npm install chromepet
```This file `example/zenhub.js` is to check if a new version of ZenHub Chrome Extension has been published on Chrome Web Store.
```js
var chromepet = require('chromepet');chromepet({
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd',
publishingVersion: '1.0.3'
})
.watch()
.on('end', function(extension, totalSeconds) {
console.log(util.format('New version %s is published! %s.',
extension.version,
extension.interactionCount));
console.log('Total seconds:', totalSeconds);
});
```#### Result
```
$ node example/zenhub.js
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
...
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
New version 1.0.3 is published! UserDownloads:9,823.
Total seconds: 1.132
```## Read Chrome Extension's Version from manifest.json
```js
var fs = require('fs');
var path = require('path');
var join = path.join;
var util = require('util');var chromepet = require('chromepet');
var manifestPath = join(__dirname, './manifest.json');
console.log('reading manifest from path', manifestPath);
var manifest = require(manifestPath);
var publishingVersion = manifest.version;chromepet({
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd',
publishingVersion: publishingVersion,
watchIntervalMS: 1000,
})
.watch()
.on('error', function(error) {
console.error('Fail to fetch', error);
})
.on('data', function(extension) {
console.log(util.format('Publishing version: %s; Published version: %s; Not published yet',
publishingVersion,
extension.version));
})
.on('end', function(extension, totalSeconds) {
console.log(util.format('New version %s is published! %s.',
extension.version,
extension.interactionCount));
console.log('Total seconds:', totalSeconds);
});
```## Contributors
* [Leo Zhang](https://github.com/zhangchiqing)