npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

brothermfc

v1.0.2

Published

Access Brother MFC web UI details with node.js

Downloads

3

Readme

brothermfc

Access Brother MFC web UI details with node.js

npm Build Status Dependency Status

Example

var brother = require ('brothermfc') ({
  hostname: 'myprinter.lan'
});

brother.current (function (err, data) {
  console.log (err || data);
});

Installation

Normal: npm install brothermfc

Development: npm install fvdm/nodejs-brothermfc

Configuration

param | type | required | default | description :--------|:-------|:---------|:--------|:------------------------------------------ hostname | string | yes | | Printer hostname or IP port | number | no | 80 | Printer web UI port protocol | string | no | http | Printer web UI protocol, http or https prefix | string | no | | Printer web UI prefix ippPort | number | no | 631 | Printer IPP service port timeout | number | no | 5000 | Web require time out in ms, 1000 = 1 sec

Example

var brother = require ('brothermfc') ({
  hostname: 'printer.lan',
  protocol: 'https'
});

current

( callback )

Get current information, like display text and ink levels, directly from the IPP interface. This is the most accurate information compared to the general.status method which is a calculation.

Note: this method may also work with other models and brands.

param | type | required | description :--------|:---------|:---------|:----------- callback | function | yes | see Usage.

Example

brother.current (callback);

Output

{ state: 'idle',
  stateReasons: 'none',
  jobs: 0,
  uptime: 613845,
  uptimeDate: Tue Nov 18 2014 03:47:22 GMT+0100 (CET),
  ink: {
    magenta: 100,
    cyan: 100,
    yellow: 98,
    black: 86
  }
}

property | description :------------|:-------------------------------------- state | short status message stateReasons | more descriptive status message jobs | print tasks running and queued uptime | seconds since last boot uptimeDate | Date object from uptime ink | inklevels in %, colors depend in model

general.status

( callback )

Get basic status details, like display text and ink levels.

Note: ink levels are less accurate then the .current method.

param | type | required | description :--------|:---------|:---------|:----------- callback | function | yes | see Usage.

Example

brother.general.status (callback);

Output

{ model: 'MFC-J4710DW',
  status: 'moniOk',
  message: 'Gereed',
  ink: { magenta: 100, cyan: 100, yellow: 100, black: 91 },
  contact: 'Franklin',
  location: 'Here' }

general.information

( callback )

Get information specific to the device, i.e. IP-address and serialnumber.

param | type | required | description :--------|:---------|:---------|:----------- callback | function | yes | see Usage.

brother.general.information (callback);

Output

{ node_name: 'BRA123BC456DE78',
  model_name: 'Brother MFC-J4710DW',
  location: 'Here',
  contact: 'Franklin',
  ip_address: '192.168.1.158',
  serial_no: 'A12345B678',
  firmware_version: 'H',
  page_counter: 26 }

general.sleep

( [preset], callback )

Get or change the device's sleep timeout.

param | type | required | description :--------|:---------|:---------|:----------- preset | number | no | Preset number corresponding to minutes callback | function | yes | see Example

Get

brother.general.sleep (callback);

Output

{
  presets: {
    1: 2,
    2: 3,
    3: 5,
    4: 10,
    5: 30,
    6: 60
  ],
  value: {
    key: 4, minutes: 10
  }
}

The presets property are the predefined minutes you can choose from. The value property is the current setting.

Change

// set to key `5` = 30 minutes
brother.general.sleep (5, callback);

Output

  • OK: data is true (boolean)
  • Fail: err is Error: POST failed with err.error

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org

Author

Franklin van de Meent