Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgco committed Jun 19, 2012
0 parents commit 68ca1d1
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .gitignore
@@ -0,0 +1,36 @@
# Node.js with Express and Stlyus
public/css/*.css
public/css/main/*.css
public/css/admin/*.css
/.monitor

/log
/data
/cache

/public/js/compact

# Windows
Thumbs.db

# Vim
.*.sw[a-z]
*.un~i
tags

# OsX
.DS_Store
Icon?
._*
.Spotlight-V100
.Trashes

# nodejs npm modules
node_modules

# node-cluster
/pids
*.sock

# ZSH Cake plugin cache
/.cake_task_cache
5 changes: 5 additions & 0 deletions .nodemonignore
@@ -0,0 +1,5 @@
public/css/*
public/fonts/*
public/images/*
public/js/compact/*
views/*
12 changes: 12 additions & 0 deletions Makefile
@@ -0,0 +1,12 @@
test:
@./node_modules/.bin/mocha \
-r should \
-R spec

lint-changed:
@jshint `git status --porcelain | sed -e "s/^...//g"`

lint:
@jshint lib test

.PHONY: test lint lint-changed
34 changes: 34 additions & 0 deletions README.md
@@ -0,0 +1,34 @@
# Node lp

node-lp is an adapter to the unix 'lp(1)' command allowing files to be subitted for printing or altering a pending job. This will only work on Linux at the moment however if anyone wants a windows port then that might happen.

## Installation

Note: you need `cups` installed to use.

Node-lp can then be installed via NPM

npm install lp

Then, require the module

var Printer = require('lp')
, lp = new Printer([options])
;


## Usage

lp.queue(fileLocation, [options], listener)

lp.queue(buffer, [options], listener)

lp.stop(jobid)

lp.resume(jobid)

lp.hold(jobid)


## Licence
Licensed under the [New BSD License](http://opensource.org/licenses/bsd-license.php)
13 changes: 13 additions & 0 deletions lib/printer.js
@@ -0,0 +1,13 @@
var events = require('events')
, child_process = require('child_process')
;

module.exports.createPrinter = function(device, options) {

options = options || {};

var self = new events.EventEmitter()
;

return self;
};
1 change: 1 addition & 0 deletions lp.js
@@ -0,0 +1 @@
module.exports = require('./lib/printer').createPrinter;
12 changes: 12 additions & 0 deletions package.json
@@ -0,0 +1,12 @@
{ "name": "lp"
, "version": "0.0.1"
, "private": true
, "engine": "~0.6"
, "dependencies":
{
}
, "devDependencies":
{ "mocha": "*"
, "should": "*"
}
}
3 changes: 3 additions & 0 deletions test/example.js
@@ -0,0 +1,3 @@
var Printer = require('../lp')
, lp = new Printer('/dev/video0')
;

0 comments on commit 68ca1d1

Please sign in to comment.