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

cartable

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

cartable - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

.eslintrc.js

47

index.js
const _ = require('lodash/fp');
const fs = require('fs-extra');
const Promise = require('bluebird');
const writeJSONAsync = Promise.promisify(require('fs-extra').writeJSON);
const path = require('path');
const logger = require('./libs/logger');
let packages = JSON.parse(require('./cartable.json'));
const get = pname => {
const package = _.find(
const root = process.env.PWD;
const cartablePath = path.resolve(root, 'cartable.json');
let cartable;
try {
cartable = JSON.parse(require(cartablePath));
} catch (e) {
cartable = [];
}
const get = (pname) => {
const found = _.find(
({ name }) => name === pname
)(packages);
)(cartable);
if (found) {
logger.info('Module already required');
return found;
}
if(package){
console.log('found');
}
else{
try {
const p = require(pname);
packages.push({ name: pname, content: p });
return fs.writeJSON('cartable.json', JSON.stringify(packages), (err, success) => {
if(err)
console.log(err);
return p;
});
cartable.push({ name: pname, content: p });
writeJSONAsync(cartablePath, JSON.stringify(cartable)).catch(logger.error);
return p;
} catch (e) {
return logger.error(e.message);
}
};
}
module.exports = {
get
}
};
{
"name": "cartable",
"version": "2.0.3",
"version": "2.0.4",
"description": "",

@@ -20,4 +20,14 @@ "main": "index.js",

"dependencies": {
"bluebird": "^3.5.0",
"fs-extra": "^2.1.2",
"lodash": "^4.17.4"
},
"devDependencies": {
"eslint": "^3.18.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-config-airbnb-base": "^11.1.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.10.3"
}
}
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