🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

shippify-data-parsers

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shippify-data-parsers - npm Package Compare versions

Comparing version

to
1.0.3

.npmignore

11

index.js

@@ -7,2 +7,3 @@ const fs = require('fs');

const xls = require('xls-to-json');
const moment = require('moment-timezone');

@@ -61,3 +62,6 @@ /*

//The template is configurated by each company. It use the JSONPath Syntax.
const documentProcessed = tots.transform(template.template)(jsonObject);
const customFns = {
functions: { pickupDateFn }
}
const documentProcessed = tots.transform(template.template, customFns)(jsonObject);
console.log('DELIVERIES PROCESSED : ',JSON.stringify(documentProcessed, null, 2));

@@ -74,4 +78,9 @@ return cb(null, documentProcessed);

/* Helper methods */
const pickupDateFn = (zone, city, days, hour) => {
return moment.tz(`${zone}/${city}`).add(days, 'days').hour(hour).minute(0).second(0).millisecond(0).valueOf();
}
module.exports = parser;

3

package.json
{
"name": "shippify-data-parsers",
"version": "1.0.2",
"version": "1.0.3",
"description": "An library to extract information from integration files to create deliveries, the files can be *.xml, *.csv, *.xls, *.edi ",

@@ -36,2 +36,3 @@ "main": "index.js",

"moment": "2.22.2",
"moment-timezone": "^0.5.23",
"schema-inspector": "1.6.8",

@@ -38,0 +39,0 @@ "xls-to-json": "0.5.1",

@@ -14,3 +14,4 @@ {

"address": "{{$.nfeProc.NFe.infNFe.transp.transporta.xEnder._text}}, {{$.nfeProc.NFe.infNFe.transp.transporta.xMun._text}}, {{$.nfeProc.NFe.infNFe.transp.transporta.UF._text}}"
}
},
"date": "{{referenceId} | pickupDateFn:America:Sao_Paulo:1:6:__}"
},

@@ -17,0 +18,0 @@ "dropoff": {