All Projects → lesander → Fritzbox.js

lesander / Fritzbox.js

Licence: other
☎️ The leading AVM Fritz!Box API for NodeJS and JavaScript.

Programming Languages

javascript
184084 projects - #8 most used programming language
es6
455 projects

Projects that are alternatives of or similar to Fritzbox.js

Kitsu
🦊 A simple, lightweight & framework agnostic JSON:API client
Stars: ✭ 166 (+361.11%)
Mutual labels:  async, promise, npm
Before After Hook
wrap methods with before/after hooks
Stars: ✭ 49 (+36.11%)
Mutual labels:  api, async, promise
Flowa
🔥Service level control flow for Node.js
Stars: ✭ 66 (+83.33%)
Mutual labels:  api, async, promise
Wx Promise Pro
✨强大、优雅的微信小程序异步库🚀
Stars: ✭ 762 (+2016.67%)
Mutual labels:  async, promise
P Map
Map over promises concurrently
Stars: ✭ 639 (+1675%)
Mutual labels:  async, promise
Rapid.js
An ORM-like Interface and a Router For Your API Requests
Stars: ✭ 700 (+1844.44%)
Mutual labels:  api, promise
Kneden
Transpile ES2017 async/await to vanilla ES6 Promise chains: a Babel plugin
Stars: ✭ 517 (+1336.11%)
Mutual labels:  async, promise
Ws Promise Client
PROJECT MOVED: https://github.com/kdex/ws-promise
Stars: ✭ 6 (-83.33%)
Mutual labels:  async, promise
Parallec
Fast Parallel Async HTTP/SSH/TCP/UDP/Ping Client Java Library. Aggregate 100,000 APIs & send anywhere in 20 lines of code. Ping/HTTP Calls 8000 servers in 12 seconds. (Akka) www.parallec.io
Stars: ✭ 777 (+2058.33%)
Mutual labels:  api, async
Then
🎬 Tame async code with battle-tested promises
Stars: ✭ 908 (+2422.22%)
Mutual labels:  async, promise
Gitter Api
[production-ready] Gitter API implementation for php 7.0+ allowing sync, async and streaming access.
Stars: ✭ 11 (-69.44%)
Mutual labels:  api, async
Posterus
Composable async primitives with cancelation, control over scheduling, and coroutines. Superior replacement for JS Promises.
Stars: ✭ 536 (+1388.89%)
Mutual labels:  async, promise
Node Serialport
Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!
Stars: ✭ 5,015 (+13830.56%)
Mutual labels:  promise, iot
Awaitkit
The ES8 Async/Await control flow for Swift
Stars: ✭ 709 (+1869.44%)
Mutual labels:  async, promise
Dorita980
Unofficial iRobot Roomba and Braava (i7/i7+, 980, 960, 900, e5, 690, 675, m6, etc) node.js library (SDK) to control your robot
Stars: ✭ 523 (+1352.78%)
Mutual labels:  api, iot
Pytradfri
IKEA Trådfri/Tradfri API. Control and observe your lights from Python. Examples available. On pypi. Sans-io.
Stars: ✭ 778 (+2061.11%)
Mutual labels:  api, iot
Vue Loadable
⏳ Improve your loading state control with pretty simple methods and helpers.
Stars: ✭ 23 (-36.11%)
Mutual labels:  async, promise
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+109866.67%)
Mutual labels:  api, async
Nodespider
[DEPRECATED] Simple, flexible, delightful web crawler/spider package
Stars: ✭ 33 (-8.33%)
Mutual labels:  async, promise
V8 Archive
Directus Database API — Wraps Custom SQL Databases with a REST/GraphQL API
Stars: ✭ 486 (+1250%)
Mutual labels:  api, iot

FritzBox.js

GitHub release Completion Status Build Status npm Code Climate BCH compliance

The most powerful, simple and complete AVM Fritz!Box API.

This project is still a work in progress. See issue #1 for the current status.

Getting Started

This module is future-proof and uses async/await promises.

This means that you need to run NodeJS version 7.6.0 or newer. If your NodeJS version is between 7.0.0 and 7.5.0 you can use the harmony flag --harmony-async-await to make use of the async/await promises.

This package was tested on Fritz!Box 7390 and 7490, with firmware versions 6.53, 6.51 and 6.83.

Installing

npm install fritzbox.js

Usage

A simple example showing how to get the history of calls made with a Fritz!Fon can be seen below.

const fritz = require('fritzbox.js')
const options = {
  username: 'xxx',
  password: 'xxx',
  server: 'fritz.box',
  protocol: 'https' }

;(async () => {

  const calls = await fritz.getCalls(options)
  if (calls.error) return console.log('Error: ' + calls.error.message)
  console.log('Got ' + calls.length + 'calls.')

})()

To minimize overhead and limit login requests made to the Fritz!Box it is recommended to store the SID once one has been obtained using fritz.getSessionId.

Documentation

Want to get started with FritzBox.js? Cool! The API is documented and available here, and you can see some examples in the test/ folder.

Contributing

If you'd like to contribute to FritzBox.js, or file a bug or feature request, please head over to the issue tracker or open a pull request.

Migrating from 1.x.x to 2.x.x

FritzBox.js v2.x is not backwards compatible with v1.x. One of the mayor changes includes the switch to async/await Promises. In v1.x, Promises were implemented with a then, catch:

fritz.getCalls(options)
.then((callHistory) => {
  console.log(callHistory)
})
.catch((error) => {
  console.log(error)
})

With v2.x, the catch will no longer catch any errors, since the module is now built to provide support for await. Any errors will be passed along like this:

fritz.getCalls(options)
.then((callHistory) => {
  if (callHistory.error) return console.log(callHistory.error.message)
  console.log(callHistory)
})

Of course, this can be simplified using await:

let callHistory = await fritz.getCalls(options)
if (callHistory.error) return console.log(callHistory.error.message)
console.log(callHistory)

Note that any Promise waiting to be fulfilled using await should be put inside an async function.

For more changes, please see the roadmap.

License

This software is open-sourced under the MIT License (see the LICENSE file for the full license).

You are required to include a copy of this project's license and copyright notice in your modified or distributed version of FritzBox.js

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].