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

io-cep-cli

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io-cep-cli - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

man/correios.1

36

cli.js

@@ -12,8 +12,17 @@ #!/usr/bin/env node

const error = chalk.bold.red;
let input;
function fail(err) {
process.stdout.write(`${error('\u2716')} ${err}\n`);
process.stdout.write(`${error('\u2716')} ${err.message}\n`);
process.exit(1);
}
function showSuccess(dados) {
const head = Object.keys(dados);
const values = head.map(k => dados[k]);
const table = new Table({head});
table.push(values);
process.stdout.write(`${table.toString()}\n`);
}
function success(res) {

@@ -26,7 +35,6 @@ if (res.hasOwnProperty('success')) {

}
const head = Object.keys(res);
const values = head.map(k => res[k]);
const table = new Table({head});
table.push(values);
process.stdout.write(`${table.toString()}\n`);
for (const dados of res.dados) {
dados.req = res.req;
showSuccess(dados);
}
process.exit();

@@ -37,9 +45,7 @@ }

.version(pkg.version)
.usage('<zipcode>')
.description('Search address using zip code')
.arguments('<zipcode>')
.action(zipcode => {
consulta(zipcode)
.then(success)
.catch(fail);
.description('Busca por informações de uma localidade através do endereço ou CEP')
.usage('<input>')
.arguments('<input>')
.action(req => {
input = String(req);
})

@@ -51,1 +57,5 @@ .parse(process.argv);

}
consulta(input)
.then(success)
.catch(fail);
{
"name": "io-cep-cli",
"version": "1.0.0",
"description": "Search address using zip code through Correios",
"version": "2.0.0",
"description": "Busca por informações de uma localidade através do endereço ou CEP utilizando os Correios",
"keywords": [

@@ -24,13 +24,18 @@ "cli-app",

},
"main": "cli.js",
"directories": {
"man": "./man"
},
"files": [
"cli.js",
"man"
],
"preferGlobal": true,
"bin": {
"cep": "cli.js"
"correios": "./cli.js"
},
"man" : "./man/correios.1",
"repository": "lagden/io-cep-cli",
"scripts": {
"pretest": "xo",
"test": "mocha --reporter spec --require should",
"prepublish": "npm test",
"start": "watch xo"
"build-man": "mdast doc/*.?.md --config-path .mdastrc-man --quiet",
"test": "ava"
},

@@ -41,5 +46,5 @@ "engines": {

"devDependencies": {
"mocha": "*",
"should": "*",
"watch": "^0.16.0",
"ava": "^0.2.0",
"mdast": "^2.1.0",
"mdast-man": "^1.1.1",
"xo": "^0.10.0"

@@ -51,3 +56,3 @@ },

"commander": "^2.8.1",
"io-cep": "^0.5.3"
"io-cep": "^2.1.1"
},

@@ -61,12 +66,24 @@ "xo": {

"rules": {
"arrow-parens": [2, "as-needed"],
"prefer-reflect": [2, {
"exceptions": ["delete"]
}],
"new-cap": [2, {
"newIsCap": true,
"capIsNew": false
}]
"arrow-parens": [
2,
"as-needed"
],
"prefer-reflect": [
2,
{
"exceptions": [
"delete"
]
}
],
"new-cap": [
2,
{
"newIsCap": true,
"capIsNew": false
}
],
"lines-around-comment": 0
}
}
}

@@ -1,15 +0,9 @@

# io-cep-cli
[![NPM version](https://img.shields.io/npm/v/io-cep-cli.svg)](https://www.npmjs.com/package/io-cep-cli)
[![Build Status](https://travis-ci.org/lagden/io-cep-cli.svg?branch=1.0.0)](https://travis-ci.org/lagden/io-cep-cli)
# io-cep-cli [![NPM version](https://img.shields.io/npm/v/io-cep-cli.svg)](https://www.npmjs.com/package/io-cep-cli)
[![Build Status](https://travis-ci.org/lagden/io-cep-cli.svg?branch=2.0.0)](https://travis-ci.org/lagden/io-cep-cli)
[![Dependency Status](https://david-dm.org/lagden/io-cep-cli.svg)](https://david-dm.org/lagden/io-cep-cli)
[![devDependency Status](https://david-dm.org/lagden/io-cep-cli/dev-status.svg)](https://david-dm.org/lagden/io-cep-cli#info=devDependencies)
> Search address using zip code through Correios
> Busca por informações de uma localidade através do endereço ou CEP utilizando os [Correios](http://www.correios.com.br/)
## CLI
![Demo cep CLI](https://raw.githubusercontent.com/lagden/io-cep-cli/master/demo.gif)
#### Install

@@ -24,10 +18,12 @@

### Por CEP
```
$ cep 04080001
$ correios 04080001
```
or
### Por endereço
```
$ cep 04080-001
$ correios "Rua Primo Modolin"
```

@@ -34,0 +30,0 @@

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