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

eastwood

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eastwood - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0-alpha.1

74

index.js

@@ -0,1 +1,75 @@

#! /usr/bin/env node
// Based on https://gist.github.com/oculus42/99092766633ca2451e9d6e2217a94a80
const cmd = require('node-cmd');
const defaultArgs = ['airbnb'];
const installPackages = (packageList = []) => {
return new Promise((resolve, reject) => {
cmd.get(`npm install ${packageList.join(' ')}`, (err, data, stderr) => {
if (err) {
reject(err);
return;
}
resolve({
data,
stderr,
});
});
});
};
const methods = {
airbnb: function () {
const packages = [
'eslint',
'eslint-plugin-import',
'eslint-plugin-react',
'eslint-plugin-jsx-a11y',
'eslint-config-airbnb',
];
return installPackages(packages);
},
'airbnb-base': function () {
const packages = [
'eslint',
'eslint-plugin-import',
'eslint-config-airbnb-base',
];
return installPackages(packages);
},
};
// Write your NodeJS scripts to run from the command line or be required.
if (!module.parent) {
// Directly invoked.
// Slice out the script from the args
const origArgs = process.argv.slice(process.argv[0].endsWith('node') ? 2 : 1);
// Optional default logic if no arguments were provided
const myArgs = origArgs.length < 3 ? defaultArgs : origArgs;
const method = myArgs[0];
// Check if the argument is one of our named methods
if (methods[method]) {
// Args arrive as strings, so this might need more work.
// Arrays and Objects are probably not convenient.
console.log(`Installing ${method}`);
// Execute our method with the rest of the command-line arguments
methods[method].apply(null, myArgs.slice(1))
.then(({data}) => console.log(data), err => console.error(err));
} else {
// You could put a default here if you don't want it to use the methods above
console.log('The method you requested was not found.');
}
} else {
// Required by another file
module.exports = methods;
}

34

package.json
{
"name": "eastwood",
"version": "1.0.0",
"description": "Linter",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"author": {
"name": "Samuel Rouse"
},
"repository": {
"type": "git",
"url": "git+https://github.com/oculus42/eastwood.git"
"bugs": {
"url": "https://github.com/oculus42/eastwood/issues"
},
"dependencies": {
"node-cmd": "^3.0.0"
},
"description": "Linter",
"homepage": "https://github.com/oculus42/eastwood#readme",
"keywords": [
"lint"
],
"author": "Samuel Rouse",
"license": "MIT",
"bugs": {
"url": "https://github.com/oculus42/eastwood/issues"
"main": "index.js",
"name": "eastwood",
"repository": {
"type": "git",
"url": "git+https://github.com/oculus42/eastwood.git"
},
"homepage": "https://github.com/oculus42/eastwood#readme",
"dependencies": {
"eslint": "^3.8.0"
}
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "2.0.0-alpha.1"
}
# eastwood
Linter
## Do you feel linty?
`eastwood` aims to provide automated install and setup of various linting rulesets.
## Installation
```bash
npm install -g eastwood
```
## Use
```bash
eastwood airbnb
```
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