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

@netlify/framework-info

Package Overview
Dependencies
Maintainers
12
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/framework-info - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

36

CHANGELOG.md

@@ -10,2 +10,38 @@ # Changelog

## [v0.2.0](https://github.com/netlify/framework-info/compare/v0.1.3...v0.2.0)
### Merged
- Add `hasFramework()` [`#31`](https://github.com/netlify/framework-info/pull/31)
- chore(deps): update dependency eslint-config-prettier to v6.14.0
[`#29`](https://github.com/netlify/framework-info/pull/29)
- Add `is-plain-obj` to `renovate.json5` [`#28`](https://github.com/netlify/framework-info/pull/28)
- chore(deps): update dependency eslint-config-prettier to v6.13.0
[`#26`](https://github.com/netlify/framework-info/pull/26)
- chore(deps): update dependency ajv to v6.12.6 [`#25`](https://github.com/netlify/framework-info/pull/25)
- chore(deps): update dependency gh-release to v4.0.3 [`#24`](https://github.com/netlify/framework-info/pull/24)
- Add `del` to `renovate.json5` [`#23`](https://github.com/netlify/framework-info/pull/23)
- chore(deps): update dependency eslint-plugin-import to v2.22.1
[`#21`](https://github.com/netlify/framework-info/pull/21)
- chore(deps): update dependency eslint-config-prettier to v6.12.0
[`#20`](https://github.com/netlify/framework-info/pull/20)
- chore(deps): update dependency gh-release to v4.0.2 [`#19`](https://github.com/netlify/framework-info/pull/19)
- chore(deps): update dependency auto-changelog to v2.2.1 [`#18`](https://github.com/netlify/framework-info/pull/18)
- Add `yargs` to `renovate.json5` [`#17`](https://github.com/netlify/framework-info/pull/17)
- chore(deps): update dependency ajv to v6.12.5 [`#14`](https://github.com/netlify/framework-info/pull/14)
- chore(deps): update dependency gh-release to v4 [`#15`](https://github.com/netlify/framework-info/pull/15)
- chore(deps): lock file maintenance [`#13`](https://github.com/netlify/framework-info/pull/13)
- chore(deps): lock file maintenance [`#11`](https://github.com/netlify/framework-info/pull/11)
- chore(deps): lock file maintenance [`#9`](https://github.com/netlify/framework-info/pull/9)
- chore(deps): lock file maintenance [`#6`](https://github.com/netlify/framework-info/pull/6)
### Commits
- Merge pull request #30 from netlify/renovate/actions-checkout-2.x
[`7dbe1c0`](https://github.com/netlify/framework-info/commit/7dbe1c03f020ce1dc703b58a756039160078bfe5)
- chore(deps): update actions/checkout action to v2
[`b9086ab`](https://github.com/netlify/framework-info/commit/b9086ab3a30d727c5e3f7c966fb6772be7a5f2e1)
- Merge pull request #10 from netlify/renovate/lock-file-maintenance
[`6d87bdf`](https://github.com/netlify/framework-info/commit/6d87bdf9971c5bec2614d9cc4d82c27b596fb88d)
## [v0.1.3](https://github.com/netlify/framework-info/compare/v0.1.2...v0.1.3) - 2020-08-07

@@ -12,0 +48,0 @@

4

package.json
{
"name": "@netlify/framework-info",
"version": "0.1.3",
"version": "0.2.0",
"description": "Framework detection utility",

@@ -80,3 +80,3 @@ "main": "./src/main.js",

"get-bin-path": "^4.0.1",
"gh-release": "^3.5.0",
"gh-release": "^4.0.0",
"husky": "^3.1.0",

@@ -83,0 +83,0 @@ "npm-run-all": "^4.1.5",

@@ -23,3 +23,3 @@ [![npm version](https://img.shields.io/npm/v/@netlify/framework-info.svg)](https://npmjs.org/package/@netlify/framework-info)

```js
const { listFrameworks, getFramework } = require('@netlify/framework-info')
const { listFrameworks, hasFramework, getFramework } = require('@netlify/framework-info')

@@ -54,2 +54,5 @@ console.log(await listFrameworks({ projectDir: './path/to/gatsby/website' }))

console.log(await hasFramework('vue', { projectDir: './path/to/vue/website' }))
// true
console.log(await getFramework('vue', { projectDir: './path/to/vue/website' }))

@@ -166,2 +169,9 @@ // {

## hasFramework(frameworkName, options?)
`options`: `object?`\
_Return value_: `Promise<boolean>`
Same as [`listFramework()`](#listframeworksoptions) except only for a specific framework and returns a boolean.
## getFramework(frameworkName, options?)

@@ -168,0 +178,0 @@

@@ -35,4 +35,23 @@ const pFilter = require('p-filter')

/**
* Return whether a project uses a specific framework
*
* @param {string} frameworkName - Name such as `"gatsby"`
* @param {object} [options] - Options
* @param {string} [flags.projectDir=process.cwd()] - Project's directory
* @param {string} [flags.ignoredWatchCommand] - When guessing the watch command, ignore `package.json` `scripts` whose value includes this string
*
* @returns {boolean} result - Whether the project uses this framework
*/
const hasFramework = async function(frameworkName, opts) {
const framework = getFrameworkByName(frameworkName)
const { projectDir, ignoredWatchCommand } = getOptions(opts)
const { npmDependencies } = await getProjectInfo({ projectDir, ignoredWatchCommand })
const result = await usesFramework(framework, { projectDir, npmDependencies })
return result
}
/**
* Return some information about a framework used by a project.
*
* @param {string} frameworkName - Name such as `"gatsby"`
* @param {object} [options] - Options

@@ -86,2 +105,2 @@ * @param {string} [flags.projectDir=process.cwd()] - Project's directory

module.exports = { listFrameworks, getFramework }
module.exports = { listFrameworks, hasFramework, getFramework }
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