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

printer-express

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

printer-express

Share standard printers via JSON API

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Printer Express

Share standard printers via JSON API

Build Status

Usage

Standalone

Clone repository:

git clone git@github.com:yevgenko/printer-express.git

Install dependencies:

cd printer-express
npm i

Run the server (default port is 3000, but can be adjusted via environment variable PORT):

node standalone.js

ExpressJS Middleware

Install printer-express package with npm:

npm i printer-express --save

Use middleware with Express application:

var express = require('express'),
    printerExpress = require('printer-express'),
    app = express(),
    port = process.env.PORT || 3000;

// mount point for JSON API, i.e. /cloudprint/printers and /cloudprint/jobs
app.use('/cloudprint', printerExpress);
app.listen(port);

JSON API

GET /printers

Get the list of printers installed on the hosting system:

curl -v http://localhost:3000/printers

or with jQuery:

$.getJSON("http://localhost:3000/printers");

POST /jobs

Submit new printing job:

curl -v -X POST http://localhost:3000/jobs -H "Content-Type: application/json" -d '{"data":"Hello, World!", "type":"RAW", "printer":"stkPrinter"}'

or with jQuery:

$.ajax({
  type: 'POST',
  url: "http://localhost:3000/jobs",
  data: JSON.stringify({data: 'Hello, World!', type: 'RAW', printer: 'stkPrinter'}),
  dataType: 'json',
  contentType: "application/json; charset=utf-8"
});

Keywords

FAQs

Package last updated on 13 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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