Comparing version 1.0.1 to 1.1.0
'use strict'; | ||
const fetch = require('node-fetch'); | ||
console.log('this:', this); | ||
let fetcher; | ||
if (typeof fetch === 'undefined') { | ||
fetcher = require('node-fetch'); | ||
} else { | ||
fetcher = fetch; | ||
} | ||
class Dymo { | ||
@@ -23,3 +30,3 @@ constructor(options) { | ||
return fetch(`${this.apiUrl}/PrintLabel`, | ||
return fetcher(`${this.apiUrl}/PrintLabel`, | ||
{ | ||
@@ -39,3 +46,3 @@ method: 'POST', | ||
return fetch(`${this.apiUrl}/GetPrinters`) | ||
return fetcher(`${this.apiUrl}/GetPrinters`) | ||
.then((response) => response.text()); | ||
@@ -45,2 +52,6 @@ } | ||
module.exports = Dymo; | ||
if (module && module.exports) { | ||
module.exports = Dymo; | ||
} else { | ||
window.Dymo = Dymo; | ||
} |
{ | ||
"name": "dymojs", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "A pure javascript library for printing labels on a Dymo Labelwriter printer from the browser or from nodejs.", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 0" | ||
"test": "mocha tests/" | ||
}, | ||
@@ -17,2 +17,6 @@ "keywords": [ | ||
"license": "ISC", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/dsandor/dymojs.git" | ||
}, | ||
"devDependencies": { | ||
@@ -23,5 +27,4 @@ "chai": "^3.5.0", | ||
"dependencies": { | ||
"form-data": "^2.1.2", | ||
"node-fetch": "^1.6.3" | ||
} | ||
} |
# dymojs | ||
[![Build Status](https://travis-ci.org/dsandor/dymojs.svg?branch=master)](https://travis-ci.org/dsandor/dymojs) | ||
#### Wicked simple pure javascript cross platform Dymo Labewriter printing module for Node.js with no platform dependencies. | ||
@@ -4,0 +6,0 @@ |
@@ -7,4 +7,10 @@ 'use strict'; | ||
describe('dymo library', () => { | ||
it('should get printers', (done) => { | ||
it('should create an instance of the Dymo class', () => { | ||
let dymo = new Dymo(); | ||
expect(dymo).to.not.be.undefined; | ||
}); | ||
it.skip('should get printers', (done) => { | ||
let dymo = new Dymo(); | ||
dymo.getPrinters() | ||
@@ -11,0 +17,0 @@ .then((printersResponseText) => { |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
16782
1
7
114
1
93
1
2
- Removedform-data@^2.1.2
- Removedasynckit@0.4.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedform-data@2.5.2(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedsafe-buffer@5.2.1(transitive)