https://github.com/peralva/npm-jamef
NPM Jamef
https://github.com/peralva/npm-jamef
jamef npm sdk
Last synced: 4 months ago
JSON representation
NPM Jamef
- Host: GitHub
- URL: https://github.com/peralva/npm-jamef
- Owner: peralva
- License: mit
- Created: 2025-03-13T11:13:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-20T19:11:51.000Z (over 1 year ago)
- Last Synced: 2025-09-23T00:39:52.469Z (9 months ago)
- Topics: jamef, npm, sdk
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/jamef
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jamef
Jamef
[](https://www.npmjs.com/package/jamef?activeTab=versions)
[](https://github.com/peralva/npm-jamef/releases)
[](https://github.com/peralva/npm-jamef?tab=MIT-1-ov-file#readme)
[](https://www.npmjs.com/package/jamef)
[](https://github.com/peralva/npm-jamef/actions/workflows/npm-publish.yml)
## Installation
```bash
npm install --save jamef
```
## Usage
```ts
import { Jamef } from 'jamef';
const jamef = new Jamef('sistemas@jamef.com.br', '12343456');
(async () => {
const response = await jamef.sendInvoice({
notasFiscais: [
{
remetente: {
documento: '12345678000123',
nome: 'EMPRESA EXEMPLO LTDA',
logradouro: 'RUA DAS FLORES',
numeroEndereco: '500',
complementoEndereco: 'BLOCO A',
bairro: 'CENTRO',
codigoIbge: '1234567',
municipio: 'EXEMPLOMUNI',
estado: 'EX',
cep: '12345000',
telefone: '40028922',
inscricaoEstadual: 'ISENTO',
email: 'contato@exemplo.com',
},
destinatario: {
documento: '98765432000198',
nome: 'CLIENTE EXEMPLAR S/A',
logradouro: 'AV. DOS NEGÓCIOS',
numeroEndereco: '1000',
complementoEndereco: 'TORRE 2',
bairro: 'NEGÓCIOS',
codigoIbge: '7654321',
indicadorInscricaoEstadual: '1',
municipio: 'EXEMPLOMUNI',
estado: 'NG',
cep: '98765000',
telefone: '08001234567',
inscricaoEstadual: '123456789',
email: 'exemplo@cliente.com',
},
frete: {
pagadorFrete: '1',
tipoNotaFiscal: '1',
numeroNotaFiscal: '123456',
serieNotaFiscal: '1',
dataEmissaoNotaFiscal: new Date('2023-12-18'),
quantidadeVolumeNotaFiscal: 5,
pesoNotaFiscal: 50,
pesoCubadoNotaFiscal: 0.75,
metragemCubica: 0.05,
valorNotaFiscal: 1000,
cfop: '5102',
numeroPedido: '',
chaveNotaFiscal: '12345678901234567890123456789012345678901234',
videNotaFiscal: '2',
clienteRetira: '2',
filialNotaFiscal: '01',
},
},
],
});
if (response.status !== 200) {
let messageError;
if ('mensagem' in response.body) {
messageError = response.body.mensagem;
} else {
messageError = response.body.error;
}
throw new Error(messageError);
}
console.log(response.body.dado[0]);
})();
```