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

dymojs

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

dymojs - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

README.md

35

lib/index.js
'use strict';
const fetch = require('node-fetch');
class Dymo {

@@ -17,17 +19,26 @@ constructor(options) {

print(printerName, labelXml) {
let encodedLabel = encodeURIComponent(labelXml),
requestPayload = {
labelXml: encodedLabel,
printerName,
labelSetXml: undefined,
printParamsXml: undefined
};
let label = `printerName=${encodeURIComponent(printerName)}&printParamsXml=&labelXml=${encodeURIComponent(labelXml)}&labelSetXml=`;
return fetch(this.apiUrl,
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
return fetch(`${this.apiUrl}/PrintLabel`,
{
method: 'POST',
body: JSON.stringify(requestPayload),
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
});
body: label,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
.then((response) => response.text())
.then((result) => result);
}
}
getPrinters() {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
return fetch(`${this.apiUrl}/GetPrinters`)
.then((response) => response.text());
}
}
module.exports = Dymo;
{
"name": "dymojs",
"version": "1.0.0",
"version": "1.0.1",
"description": "A pure javascript library for printing labels on a Dymo Labelwriter printer from the browser or from nodejs.",

@@ -16,3 +16,11 @@ "main": "lib/index.js",

"author": "David Sandor",
"license": "ISC"
"license": "ISC",
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^3.2.0"
},
"dependencies": {
"form-data": "^2.1.2",
"node-fetch": "^1.6.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