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

@copcart/node-hikvision-api

v0.0.8

Published

HikVision HTTP ISAPI Module

Downloads

42

Readme

node-hikvision-api

GPL-3.0 npm node

A Node.js Module for communication with HikVision IP Cameras, now updated with Typescript and proper ISAPI calls.

Getting Started:

Installing:

npm i @copcart/node-hikvision-api

Importing:

import { HikVision } from '@copcart/node-hikvision-api';

Configuring:

const camera = new HikVision({
  username: 'admin',     // Required
  password: 'password',  // Required
  host: '192.168.1.64',  // Required
  debug: true,           // Optional, defaults to false
  port: 80,              // Optional, defaults to 80
  reconnectAfter: 30000, // Optional, defaults to 30000 (30s)
  protocol: 'http',      // Optional, defaults to 'http'
});

Additionally, you can run examples (available in examples/) like shown:

npm run example:basic CAMERA_IP CAMERA_PASSWORD CAMERA_USERNAME  

There are more examples available as npm scripts, so please check package.json

Status

Work in Progress

Working:

  • View/update stream channel parameters
    • Partial validation before sending XML is possible, see example 5
  • Get device status
  • Enable/disable ONVIF
  • Add/remove ONVIF users
  • Checking for day mode/night mode
  • Camera alarm handling (see below)

Encryption:

Though HikVision's ISAPI protocol supports security using URL parameters, I was unable to get it working properly. Anyone is welcome to pick up where I left off in src/lib/hikvision.encryption.ts.

The ISAPI spec includes the full steps in Chapter 3, but this is the general idea: ISAPI encryption steps ISAPI encryption steps

Without encryption one should not use this library to pass sensitive data at all even if you are using HTTPS.

Notes

There are major differences between this library and the original one

For instance, the previous version of this library had PTZ functionalities, however this is not within the scope of this library. In my own opinion, you should be using ONVIF for those functions.

Roadmap

  • Implement proper sensitive data encryption
  • Write unit tests
  • Implement NetworkInterface validation
  • Return PTZ capabilities
  • Basic error handling (right now the axios ref is thrown all the way up the stack)
  • Clean up alarm notification handling