New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

neuron-tree

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

neuron-tree - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

24

index.js

@@ -16,3 +16,4 @@ 'use strict';

// - shrinkwrap {Object=}
function tree (cwd, pkg, options, callback) {
// - cwd {path}
function tree (pkg, options, callback) {
options || (options = {});

@@ -27,3 +28,3 @@ (options.dependencyKeys) || (options.dependencyKeys = ['dependencies', 'asyncDependencies']);

tree.read_shrinkwrap(cwd, pkg, options, function (err, tree) {
tree.read_shrinkwrap(pkg, options, function (err, tree) {
if (err) {

@@ -44,15 +45,20 @@ return done(err);

var keys = options.dependencyKeys;
var result = tree.parse(pkg, options.shrinkwrap, keys);
callback(null, result);
});
};
var shrinked_tree = shrinked.parse(options.shrinkwrap, {
dependencyKeys: keys
});
var result = tree.parse_shrinked(shrinked_tree, keys);
callback(null, result);
tree.parse = function (pkg, shrinkwrap_object, keys) {
var shrinked_tree = shrinked.parse(shrinkwrap_object, {
dependencyKeys: keys
});
var result = tree.parse_shrinked(shrinked_tree, keys);
return result;
};
tree.read_shrinkwrap = function (cwd, pkg, options, callback) {
var shrinkwrap_json = node_path.join(cwd, 'cortex-shrinkwrap.json');
tree.read_shrinkwrap = function (pkg, options, callback) {
var shrinkwrap_json = node_path.join(options.cwd, 'cortex-shrinkwrap.json');

@@ -59,0 +65,0 @@ fs.exists(shrinkwrap_json, function(exists) {

{
"name": "neuron-tree",
"version": "2.0.0",
"version": "2.0.1",
"description": "Generates the config.tree of neuron",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,9 +12,7 @@ # neuron-tree [![NPM version](https://badge.fury.io/js/neuron-tree.svg)](http://badge.fury.io/js/neuron-tree) [![Build Status](https://travis-ci.org/cortexjs/neuron-tree.svg?branch=master)](https://travis-ci.org/cortexjs/neuron-tree) [![Dependency Status](https://gemnasium.com/cortexjs/neuron-tree.svg)](https://gemnasium.com/cortexjs/neuron-tree)

{
<sync-dep-range>: <sync-dep-version>
...
<sync-dep-range>: <sync-dep-version>, ...
},
// asynchronous dependencies
{
<async-dep-range>: <async-dep-version>
...
<async-dep-range>: <async-dep-version>, ...
}

@@ -24,3 +22,2 @@ ]

}
...
```

@@ -38,3 +35,7 @@

var tree = require('neuron-tree');
tree.parse(shrinked);
tree(cwd, pkg, {
shrinkwrap: shrinkwrap
}, function(err, tree){
// ...
});
```

@@ -44,22 +45,36 @@

- cwd
Generates the object tree which neuron uses as the `config.tree`.
- pkg `Object` cortex json
- options
- built_root `path=`
- shrinkwrap `Object=`
- options `Object=`
- cwd `path`
- built_root `path=` the path from where we can find all installed and built packages
- shrinkwrap `Object=` the object of cortex-shrinkwrap.json
- dependencyKeys `Array=['dependencies', 'asyncDependencies']`
### tree.parse(shrinked, dependencyKeys)
##### dependencyKeys
- shrinked `Object` the shrinked object of [shrinked](https://www.npmjs.org/package/shrinked)
- dependencyKeys `Array.<type>` the array of types of dependencies, default to
The array of types of dependencies, default to
[
"dependencies",
"asyncDependencies"
]
```
[
"dependencies",
"asyncDependencies"
]
```
you could include other keys of dependencies in the array.
You could include other keys of dependencies in the array, available keys:
- type `String` available keys: `'dependencies'`, `'asyncDependencies'`, `'engines'`, `devDependencies`
`'dependencies'`, `'asyncDependencies'`, `'engines'`, `devDependencies`
##### Arguments Overloading
- if `options.shrinkwrap` not defined, `neuron-tree` will try to read the cortex-shrinkwrap.json
-
### tree.parse(shrinked, dependencyKeys)
- shrinked `Object` the shrinked object of [shrinked](https://www.npmjs.org/package/shrinked)
- dependencyKeys `Array.<String>`
Parses the shrinked B+ tree, and generates a simpler tree for `config.tree` of neuron.

@@ -70,2 +85,2 @@

MIT
<!-- do not want to make nodeinit to complicated, you can edit this whenever you want. -->
<!-- do not want to make nodeinit to complicated, you can edit this whenever you want. -->
{
"name": "unit-m-customer",
"version": "0.0.0",
"engines": {

@@ -5,0 +4,0 @@ "neuron": {

@@ -44,2 +44,6 @@ 'use strict';

var expected = require(fixture.resolve('expected'));
var pkg = {
"name": "unit-m-customer"
"version": "0.0.0"
};

@@ -49,3 +53,4 @@ Object.keys(cases).forEach(function (type) {

describe(type, function(){
it("tree.parse()", function(){
it("tree()", function(){
tree()
var parsed = shrinked.parse(shrinkwrap, {

@@ -52,0 +57,0 @@ dependencyKeys: c.types

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