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

egg-utils

Package Overview
Dependencies
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-utils - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

5

History.md
1.1.0 / 2017-01-13
==================
* feat: support read framework from package.json (#1)
1.0.0 / 2016-06-20

@@ -3,0 +8,0 @@ ==================

13

index.js

@@ -14,3 +14,3 @@ 'use strict';

*/
exports.getFrameworkOrEggPath = function(cwd, eggNames) {
exports.getFrameworkOrEggPath = (cwd, eggNames) => {
eggNames = eggNames || ['egg'];

@@ -23,2 +23,13 @@ const moduleDir = path.join(cwd, 'node_modules');

// try to get framework
// 1. try to read egg.framework property on package.json
const pkgFile = path.join(cwd, 'package.json');
if (fs.existsSync(pkgFile)) {
const pkg = require(pkgFile);
if (pkg.egg && pkg.egg.framework) {
return path.join(moduleDir, pkg.egg.framework);
}
}
// 2. try the module dependencies includes eggNames
const names = fs.readdirSync(moduleDir);

@@ -25,0 +36,0 @@ for (const name of names) {

6

package.json
{
"name": "egg-utils",
"version": "1.0.0",
"version": "1.1.0",
"description": "Utils for all egg projects",

@@ -36,3 +36,3 @@ "main": "index.js",

"engine": {
"node": ">=4.0.0"
"node": ">=6.0.0"
},

@@ -45,4 +45,4 @@ "ava": {

"ci": {
"version": "4, 6"
"version": "6, 7"
}
}

@@ -10,12 +10,12 @@ egg-utils

[npm-image]: https://img.shields.io/npm/v/egg-ci.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-ci
[travis-image]: https://img.shields.io/travis/eggjs/egg-ci.svg?style=flat-square
[travis-url]: https://travis-ci.org/eggjs/egg-ci
[codecov-image]: https://codecov.io/github/eggjs/egg-ci/coverage.svg?branch=master
[codecov-url]: https://codecov.io/github/eggjs/egg-ci?branch=master
[david-image]: https://img.shields.io/david/eggjs/egg-ci.svg?style=flat-square
[david-url]: https://david-dm.org/eggjs/egg-ci
[download-image]: https://img.shields.io/npm/dm/egg-ci.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-ci
[npm-image]: https://img.shields.io/npm/v/egg-utils.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-utils
[travis-image]: https://img.shields.io/travis/eggjs/egg-utils.svg?style=flat-square
[travis-url]: https://travis-ci.org/eggjs/egg-utils
[codecov-image]: https://codecov.io/github/eggjs/egg-utils/coverage.svg?branch=master
[codecov-url]: https://codecov.io/github/eggjs/egg-utils?branch=master
[david-image]: https://img.shields.io/david/eggjs/egg-utils.svg?style=flat-square
[david-url]: https://david-dm.org/eggjs/egg-utils
[download-image]: https://img.shields.io/npm/dm/egg-utils.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-utils

@@ -22,0 +22,0 @@ Utils for all egg projects.

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