Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pluginclerk

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pluginclerk - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

edition-browsers/index.js

36

HISTORY.md
# History
## v2.1.0 2019 September 11
- Updated [base files](https://github.com/bevry/base) and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation)
- Updated dependencies
## v2.0.0 2018 July 12
- API updated to use promises instead
- Minimum supported node version is now version 8, due to the usage of async/await
- Updated dependencies
- API updated to use promises instead
- Minimum supported node version is now version 8, due to the usage of async/await
- Updated dependencies
## v1.2.0 2017 February 27
- Fixed registry requests failing as the default registry URL that was used no longer works, so updated to one that does
- Updated dependencies
- Added API docs
- Fixed registry requests failing as the default registry URL that was used no longer works, so updated to one that does
- Updated dependencies
- Added API docs
## v1.1.0 2016 May 27
- Updated internal conventions
- Moved from [ESNextGuardian](https://github.com/bevry/esnextguardian) to [Editions](https://github.com/bevry/editions)
- Updated internal conventions
- Moved from [ESNextGuardian](https://github.com/bevry/esnextguardian) to [Editions](https://github.com/bevry/editions)
## v1.0.3 2015 December 10
- Updated internal conventions
- Updated internal conventions
## v1.0.2 2015 September 5
- Abstracted out cache handling into more robust [cachely package](https://github.com/bevry/cachely)
- Abstracted out cache handling into more robust [cachely package](https://github.com/bevry/cachely)
## v1.0.1 2015 September 5
- Initial working release with prefixes
- Initial working release with prefixes
## v1.0.0 2015 September 4
- Initial working release
- Initial working release

@@ -18,3 +18,3 @@ <!-- LICENSEFILE/ -->

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

@@ -21,0 +21,0 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

{
"name": "pluginclerk",
"version": "2.0.0",
"version": "2.1.0",
"description": "A clerk for retrieving compatible plugins from the npm database",
"homepage": "ssh://git@github.com/bevry/pluginclerk",
"homepage": "https://github.com/bevry/pluginclerk",
"license": "MIT",

@@ -24,18 +24,21 @@ "keywords": [

"patreon",
"flattr",
"liberapay",
"thanksapp",
"boostlab",
"buymeacoffee",
"opencollective",
"flattr",
"crypto",
"paypal",
"bitcoin",
"wishlist",
"---",
"slackin"
"wishlist"
],
"config": {
"buymeacoffeeUsername": "balupton",
"cryptoURL": "https://bevry.me/crypto",
"flattrUsername": "balupton",
"liberapayUsername": "bevry",
"opencollectiveUsername": "bevry",
"patreonUsername": "bevry",
"opencollectiveUsername": "bevry",
"flattrUsername": "balupton",
"paypalURL": "https://bevry.me/paypal",
"bitcoinURL": "https://bevry.me/bitcoin",
"wishlistURL": "https://bevry.me/wishlist",
"slackinURL": "https://slack.bevry.me"
"wishlistURL": "https://bevry.me/wishlist"
}

@@ -51,7 +54,7 @@ },

"bugs": {
"url": "ssh://git@github.com/bevry/pluginclerk/issues"
"url": "https://github.com/bevry/pluginclerk/issues"
},
"repository": {
"type": "git",
"url": "ssh://git@github.com/bevry/pluginclerk.git"
"url": "https://github.com/bevry/pluginclerk.git"
},

@@ -63,70 +66,107 @@ "engines": {

{
"description": "Source + ESNext + Require",
"description": "esnext source code with require for modules",
"directory": "source",
"entry": "index.js",
"directory": "source",
"syntaxes": [
"tags": [
"javascript",
"esnext",
"require",
"let",
"const",
"destructuring",
"rest",
"spread",
"classes",
"template strings"
]
"require"
],
"engines": {
"node": "8 || 10 || 11 || 12",
"browsers": false
}
},
{
"description": "Babel Compiled + ES2015 + Require",
"description": "esnext compiled for browsers with require for modules",
"directory": "edition-browsers",
"entry": "index.js",
"directory": "es2015",
"syntaxes": [
"tags": [
"javascript",
"es2015",
"require"
]
],
"engines": {
"node": false,
"browsers": "defaults"
}
}
],
"main": "index.js",
"browser": "es2015/index.js",
"main": "source/index.js",
"browser": "edition-browsers/index.js",
"dependencies": {
"cachely": "^2.0.0",
"cachely": "^2.1.0",
"eachr": "^3.2.0",
"editions": "^1.3.4",
"node-fetch": "^2.1.2",
"semver": "^5.3.0"
"node-fetch": "^2.6.0",
"semver": "^6.3.0"
},
"devDependencies": {
"assert-helpers": "^4.5.1",
"babel-cli": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"documentation": "^8.0.0",
"eslint": "^5.1.0",
"joe": "^2.0.2",
"joe-reporter-console": "^2.0.1",
"projectz": "^1.4.0",
"surge": "^0.20.1"
"@babel/cli": "^7.6.0",
"@babel/core": "^7.6.0",
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
"@babel/preset-env": "^7.6.0",
"assert-helpers": "^4.9.6",
"eslint": "^6.3.0",
"eslint-config-bevry": "^1.2.1",
"eslint-config-prettier": "^6.2.0",
"eslint-plugin-prettier": "^3.1.0",
"jsdoc": "^3.6.3",
"kava": "^3.1.0",
"minami": "^1.2.3",
"prettier": "^1.18.2",
"projectz": "^1.7.5",
"surge": "^0.21.3",
"valid-directory": "^1.0.0"
},
"scripts": {
"our:setup": "npm run our:setup:npm",
"our:setup:npm": "npm install",
"our:clean": "rm -Rf ./docs ./es2015 ./es5 ./out",
"our:compile": "npm run our:compile:es2015",
"our:compile:es2015": "babel ./source --out-dir ./es2015 --presets es2015",
"our:clean": "rm -Rf ./docs ./edition* ./es2015 ./es5 ./out ./.next",
"our:compile": "npm run our:compile:edition-browsers",
"our:compile:edition-browsers": "env BABEL_ENV=edition-browsers babel --out-dir ./edition-browsers ./source",
"our:deploy": "echo no need for this project",
"our:meta": "npm run our:meta:docs && npm run our:meta:projectz",
"our:meta:docs": "documentation build -f html -o ./docs -g --shallow ./source/**.js",
"our:meta:docs": "npm run our:meta:docs:jsdoc",
"our:meta:docs:jsdoc": "rm -Rf ./docs && jsdoc --recurse --pedantic --access all --destination ./docs --package ./package.json --readme ./README.md --template ./node_modules/minami ./source && mv ./docs/$npm_package_name/$npm_package_version/* ./docs/ && rm -Rf ./docs/$npm_package_name/$npm_package_version",
"our:meta:projectz": "projectz compile",
"our:verify": "npm run our:verify:eslint",
"our:verify:eslint": "eslint --fix ./source",
"our:deploy": "echo no need for this project",
"our:test": "npm run our:verify && npm test",
"our:release": "npm run our:release:prepare && npm run our:release:check-changelog && npm run our:release:check-dirty && npm run our:release:tag && npm run our:release:push",
"our:release:prepare": "npm run our:clean && npm run our:compile && npm run our:test && npm run our:meta",
"our:release:check-changelog": "cat ./HISTORY.md | grep v$npm_package_version || (echo add a changelog entry for v$npm_package_version && exit -1)",
"our:release:check-dirty": "git diff --exit-code",
"our:release:prepare": "npm run our:clean && npm run our:compile && npm run our:test && npm run our:meta",
"our:release:push": "git push origin master && git push origin --tags",
"our:release:tag": "export MESSAGE=$(cat ./HISTORY.md | sed -n \"/## v$npm_package_version/,/##/p\" | sed 's/## //' | awk 'NR>1{print buf}{buf = $0}') && test \"$MESSAGE\" || (echo 'proper changelog entry not found' && exit -1) && git tag v$npm_package_version -am \"$MESSAGE\"",
"our:release:push": "git push origin master && git push origin --tags",
"test": "node --harmony ./test.js --joe-reporter=console"
"our:setup": "npm run our:setup:install",
"our:setup:install": "npm install",
"our:test": "npm run our:verify && npm test",
"our:verify": "npm run our:verify:directory && npm run our:verify:eslint && npm run our:verify:prettier",
"our:verify:directory": "npx valid-directory",
"our:verify:eslint": "eslint --fix --ignore-pattern '**/*.d.ts' --ignore-pattern '**/vendor/' --ignore-pattern '**/node_modules/' --ext .mjs,.js,.jsx,.ts,.tsx ./source",
"our:verify:prettier": "prettier --write ./source/**",
"test": "node ./source/test.js"
},
"eslintConfig": {
"extends": [
"bevry"
]
},
"prettier": {
"semi": false,
"singleQuote": true
},
"babel": {
"env": {
"edition-browsers": {
"sourceType": "script",
"presets": [
[
"@babel/preset-env",
{
"targets": "defaults",
"modules": "commonjs"
}
]
],
"plugins": [
"@babel/proposal-object-rest-spread"
]
}
}
}
}

@@ -17,9 +17,11 @@ <!-- TITLE/ -->

<span class="badge-patreon"><a href="https://patreon.com/bevry" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
<span class="badge-flattr"><a href="https://flattr.com/profile/balupton" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span>
<span class="badge-liberapay"><a href="https://liberapay.com/bevry" title="Donate to this project using Liberapay"><img src="https://img.shields.io/badge/liberapay-donate-yellow.svg" alt="Liberapay donate button" /></a></span>
<span class="badge-thanksapp"><a href="https://givethanks.app/donate/npm/pluginclerk" title="Donate to this project using Thanks App"><img src="https://img.shields.io/badge/thanksapp-donate-yellow.svg" alt="Thanks App donate button" /></a></span>
<span class="badge-boostlab"><a href="https://boost-lab.app/bevry/pluginclerk" title="Donate to this project using Boost Lab"><img src="https://img.shields.io/badge/boostlab-donate-yellow.svg" alt="Boost Lab donate button" /></a></span>
<span class="badge-buymeacoffee"><a href="https://buymeacoffee.com/balupton" title="Donate to this project using Buy Me A Coffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg" alt="Buy Me A Coffee donate button" /></a></span>
<span class="badge-opencollective"><a href="https://opencollective.com/bevry" title="Donate to this project using Open Collective"><img src="https://img.shields.io/badge/open%20collective-donate-yellow.svg" alt="Open Collective donate button" /></a></span>
<span class="badge-flattr"><a href="https://flattr.com/profile/balupton" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span>
<span class="badge-crypto"><a href="https://bevry.me/crypto" title="Donate to this project using Cryptocurrency"><img src="https://img.shields.io/badge/crypto-donate-yellow.svg" alt="crypto donate button" /></a></span>
<span class="badge-paypal"><a href="https://bevry.me/paypal" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span>
<span class="badge-bitcoin"><a href="https://bevry.me/bitcoin" title="Donate once-off to this project using Bitcoin"><img src="https://img.shields.io/badge/bitcoin-donate-yellow.svg" alt="Bitcoin donate button" /></a></span>
<span class="badge-wishlist"><a href="https://bevry.me/wishlist" title="Buy an item on our wishlist for us"><img src="https://img.shields.io/badge/wishlist-donate-yellow.svg" alt="Wishlist browse button" /></a></span>
<br class="badge-separator" />
<span class="badge-slackin"><a href="https://slack.bevry.me" title="Join this project's slack community"><img src="https://slack.bevry.me/badge.svg" alt="Slack community badge" /></a></span>

@@ -40,25 +42,36 @@ <!-- /BADGES -->

<a href="https://npmjs.com" title="npm is a package manager for javascript"><h3>NPM</h3></a><ul>
<a href="https://npmjs.com" title="npm is a package manager for javascript"><h3>npm</h3></a>
<ul>
<li>Install: <code>npm install --save pluginclerk</code></li>
<li>Module: <code>require('pluginclerk')</code></li></ul>
<li>Require: <code>require('pluginclerk')</code></li>
</ul>
<a href="http://browserify.org" title="Browserify lets you require('modules') in the browser by bundling up all of your dependencies"><h3>Browserify</h3></a><ul>
<li>Install: <code>npm install --save pluginclerk</code></li>
<li>Module: <code>require('pluginclerk')</code></li>
<li>CDN URL: <code>//wzrd.in/bundle/pluginclerk@2.0.0</code></li></ul>
<a href="https://jspm.io" title="Native ES Modules CDN"><h3>jspm</h3></a>
<a href="http://enderjs.com" title="Ender is a full featured package manager for your browser"><h3>Ender</h3></a><ul>
<li>Install: <code>ender add pluginclerk</code></li>
<li>Module: <code>require('pluginclerk')</code></li></ul>
``` html
<script type="module">
import * as pkg from '//dev.jspm.io/pluginclerk'
</script>
```
<h3><a href="https://github.com/bevry/editions" title="Editions are the best way to produce and consume packages you care about.">Editions</a></h3>
<h3><a href="https://editions.bevry.me" title="Editions are the best way to produce and consume packages you care about.">Editions</a></h3>
<p>This package is published with the following editions:</p>
<ul><li><code>pluginclerk</code> aliases <code>pluginclerk/index.js</code> which uses <a href="https://github.com/bevry/editions" title="Editions are the best way to produce and consume packages you care about.">Editions</a> to automatically select the correct edition for the consumers environment</li>
<li><code>pluginclerk/source/index.js</code> is Source + <a href="https://babeljs.io/docs/learn-es2015/" title="ECMAScript Next">ESNext</a> + <a href="https://nodejs.org/dist/latest-v5.x/docs/api/modules.html" title="Node/CJS Modules">Require</a></li>
<li><code>pluginclerk/es2015/index.js</code> is <a href="https://babeljs.io" title="The compiler for writing next generation JavaScript">Babel</a> Compiled + <a href="http://babeljs.io/docs/plugins/preset-es2015/" title="ECMAScript 2015">ES2015</a> + <a href="https://nodejs.org/dist/latest-v5.x/docs/api/modules.html" title="Node/CJS Modules">Require</a></li></ul>
<ul><li><code>pluginclerk</code> aliases <code>pluginclerk/source/index.js</code></li>
<li><code>pluginclerk/source/index.js</code> is esnext source code with require for modules</li>
<li><code>pluginclerk/edition-browsers/index.js</code> is esnext compiled for browsers with require for modules</li></ul>
<p>Older environments may need <a href="https://babeljs.io/docs/usage/polyfill/" title="A polyfill that emulates missing ECMAScript environment features">Babel's Polyfill</a> or something similar.</p>
<h3><a href="https://www.typescriptlang.org/" title="TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. ">TypeScript</a></h3>
This project provides its type information via inline <a href="http://usejsdoc.org" title="JSDoc is an API documentation generator for JavaScript, similar to Javadoc or phpDocumentor">JSDoc Comments</a>. To make use of this in <a href="https://www.typescriptlang.org/" title="TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. ">TypeScript</a>, set your <code>maxNodeModuleJsDepth</code> compiler option to `5` or thereabouts. You can accomlish this via your `tsconfig.json` file like so:
``` json
{
"compilerOptions": {
"maxNodeModuleJsDepth": 5
}
}
```
<!-- /INSTALL -->

@@ -207,6 +220,10 @@

<span class="badge-patreon"><a href="https://patreon.com/bevry" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
<span class="badge-flattr"><a href="https://flattr.com/profile/balupton" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span>
<span class="badge-liberapay"><a href="https://liberapay.com/bevry" title="Donate to this project using Liberapay"><img src="https://img.shields.io/badge/liberapay-donate-yellow.svg" alt="Liberapay donate button" /></a></span>
<span class="badge-thanksapp"><a href="https://givethanks.app/donate/npm/pluginclerk" title="Donate to this project using Thanks App"><img src="https://img.shields.io/badge/thanksapp-donate-yellow.svg" alt="Thanks App donate button" /></a></span>
<span class="badge-boostlab"><a href="https://boost-lab.app/bevry/pluginclerk" title="Donate to this project using Boost Lab"><img src="https://img.shields.io/badge/boostlab-donate-yellow.svg" alt="Boost Lab donate button" /></a></span>
<span class="badge-buymeacoffee"><a href="https://buymeacoffee.com/balupton" title="Donate to this project using Buy Me A Coffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg" alt="Buy Me A Coffee donate button" /></a></span>
<span class="badge-opencollective"><a href="https://opencollective.com/bevry" title="Donate to this project using Open Collective"><img src="https://img.shields.io/badge/open%20collective-donate-yellow.svg" alt="Open Collective donate button" /></a></span>
<span class="badge-flattr"><a href="https://flattr.com/profile/balupton" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span>
<span class="badge-crypto"><a href="https://bevry.me/crypto" title="Donate to this project using Cryptocurrency"><img src="https://img.shields.io/badge/crypto-donate-yellow.svg" alt="crypto donate button" /></a></span>
<span class="badge-paypal"><a href="https://bevry.me/paypal" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span>
<span class="badge-bitcoin"><a href="https://bevry.me/bitcoin" title="Donate once-off to this project using Bitcoin"><img src="https://img.shields.io/badge/bitcoin-donate-yellow.svg" alt="Bitcoin donate button" /></a></span>
<span class="badge-wishlist"><a href="https://bevry.me/wishlist" title="Buy an item on our wishlist for us"><img src="https://img.shields.io/badge/wishlist-donate-yellow.svg" alt="Wishlist browse button" /></a></span>

@@ -213,0 +230,0 @@

@@ -62,7 +62,9 @@ 'use strict'

class PluginClerk {
constructor (opts) {
constructor(opts) {
this.config = {}
if (!opts || !opts.keyword) {
throw new Error('The plugin clerk requires a keyword to be specified, please refer to the API specification')
throw new Error(
'The plugin clerk requires a keyword to be specified, please refer to the API specification'
)
}

@@ -74,3 +76,3 @@

this.log = opts.log || function () { }
this.log = opts.log || function() {}
this.cachely = require('cachely').create({

@@ -92,3 +94,3 @@ retrieve: this.requestDatabase.bind(this),

*/
static create (...args) {
static create(...args) {
return new this(...args)

@@ -102,5 +104,5 @@ }

*/
async requestDatabase ({ database = {}, offset = 0 } = {}) {
async requestDatabase({ database = {}, offset = 0 } = {}) {
const me = this
const nameRegex = (/[^a-z0-9]/)
const nameRegex = /[^a-z0-9]/
const url = `${me.config.registryHostname}/-/v1/search?text=keywords:${me.config.keyword}&size=250&from=${offset}`

@@ -121,14 +123,19 @@ let data = null

await Promise.all(
data.objects.map(async function (entry) {
data.objects.map(async function(entry) {
const name = entry.package.name
let pluginData = null
try {
const response = await fetch(`${me.config.registryHostname}/${name}`)
const response = await fetch(
`${me.config.registryHostname}/${name}`
)
pluginData = await response.json()
}
catch (err) {
} catch (err) {
return Promise.reject(err)
}
if (name !== pluginData.name) {
return Promise.reject(new Error('name result from search and from package did not match'))
return Promise.reject(
new Error(
'name result from search and from package did not match'
)
)
}

@@ -139,3 +146,6 @@ if (me.config.prefix) {

// invalid plugin
me.log('warn', `Plugin ${name} will be ignored as it has an invalid name, must be prefixed with: ${me.config.prefix}`)
me.log(
'warn',
`Plugin ${name} will be ignored as it has an invalid name, must be prefixed with: ${me.config.prefix}`
)
return Promise.resolve()

@@ -145,8 +155,10 @@ }

database[name] = pluginData
me.log('info', `Plugin ${name} was successfully added to the database.`)
me.log(
'info',
`Plugin ${name} was successfully added to the database.`
)
return Promise.resolve()
})
)
}
catch (err) {
} catch (err) {
me.log('error', 'Fetching database content failed', err)

@@ -163,3 +175,6 @@ return Promise.reject(err)

if (subtotal + offset !== Number(data.total)) {
me.log('info', 'Fetched a portion of the database content, grabbing the rest')
me.log(
'info',
'Fetched a portion of the database content, grabbing the rest'
)
return this.requestDatabase({ database, offset: subtotal })

@@ -178,3 +193,3 @@ }

*/
getPlugin ({ database, name, dependencies }) {
getPlugin({ database, name, dependencies }) {
const result = { success: false, message: null }

@@ -205,16 +220,18 @@ const pluginData = database[name]

const pluginVersionsData = pluginData.versions
const pluginVersionsKeysLatestFirst = Object.keys(pluginVersionsData).reverse()
eachr(pluginVersionsKeysLatestFirst, function (pluginVersion) {
const pluginVersionsKeysLatestFirst = Object.keys(
pluginVersionsData
).reverse()
eachr(pluginVersionsKeysLatestFirst, function(pluginVersion) {
const pluginVersionData = pluginVersionsData[pluginVersion]
const pluginVersionMissingPeers = []
function compat (list, type) {
eachr(list || {}, function (acceptedRange, name) {
function compat(list, type) {
eachr(list || {}, function(acceptedRange, name) {
const suppliedVersion = dependencies[name]
if (suppliedVersion) {
if (semver.satisfies(suppliedVersion, acceptedRange) === false) {
if (result.skippedVersions[pluginVersion] == null) result.skippedVersions[pluginVersion] = {}
if (result.skippedVersions[pluginVersion] == null)
result.skippedVersions[pluginVersion] = {}
result.skippedVersions[pluginVersion][name] = acceptedRange
}
}
else if (type !== 'engines') {
} else if (type !== 'engines') {
pluginVersionMissingPeers.push(name)

@@ -235,3 +252,3 @@ }

if (result.skippedVersions[pluginVersion]) {
return true // continue
return true // continue
}

@@ -242,6 +259,5 @@

result.installPeers = pluginVersionMissingPeers
return false // break
return false // break
})
}
catch (err) {
} catch (err) {
result.message = 'The compatiblity checks failed'

@@ -254,7 +270,9 @@ this.log('warn', 'The compatibility checks failed with error:', err.stack)

if (result.installVersion) {
const status = result.latestVersion === result.installVersion ? 'the latest' : 'an older'
const status =
result.latestVersion === result.installVersion
? 'the latest'
: 'an older'
result.success = true
result.message = `Successfully fetched ${status} and compatible version of the plugin ${name}`
}
else {
} else {
result.message = `Failed to find a compatible version of the plugin ${name}`

@@ -273,6 +291,10 @@ }

*/
getPlugins ({ database, dependencies }) {
getPlugins({ database, dependencies }) {
const me = this
const result = { success: true, message: 'Successfully fetched the plugins', plugins: {} }
eachr(database, function (pluginData, pluginName) {
const result = {
success: true,
message: 'Successfully fetched the plugins',
plugins: {}
}
eachr(database, function(pluginData, pluginName) {
const pluginResult = {

@@ -284,3 +306,7 @@ description: pluginData.description,

if (dependencies) {
pluginResult.compatibility = me.getPlugin({ name: pluginName, dependencies, database })
pluginResult.compatibility = me.getPlugin({
name: pluginName,
dependencies,
database
})
pluginResult.version = pluginResult.compatibility.installVersion

@@ -299,8 +325,7 @@ }

*/
async fetchPlugin (opts = {}) {
async fetchPlugin(opts = {}) {
try {
const database = await this.fetchDatabase()
opts.database = database
}
catch (err) {
} catch (err) {
return Promise.reject(err)

@@ -317,8 +342,7 @@ }

*/
async fetchPlugins (opts = {}) {
async fetchPlugins(opts = {}) {
try {
const database = await this.fetchDatabase()
opts.database = database
}
catch (err) {
} catch (err) {
return Promise.reject(err)

@@ -334,3 +358,3 @@ }

*/
fetchDatabase () {
fetchDatabase() {
return this.cachely.resolve()

@@ -337,0 +361,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc