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

node-raspistill

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-raspistill

Node wrapper for taking photos using Raspberry Pi raspistill app.

  • 0.0.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
42
increased by23.53%
Maintainers
1
Weekly downloads
 
Created
Source

node-raspistill

Build Status

Simple wrapper for taking photos using Raspberry Pi raspistill app.

Module is written in typescript and provides type definitions out-of-the-box.

Tested with Raspberry Pi 2 B (Raspbian OS), and Raspberry Camera Module v2.

##Usage

npm install node-raspistill
const Raspistill = require('node-raspistill').Raspistill;
const camera = new Raspistill();

camera.takePhoto().then((photo) => {
    ...
});

Or (if you use imports):

import {Raspistill} from 'node-raspistill';
const camera = new Raspistill();

camera.takePhoto().then((photo) => {
    ...
});

You can also pass some options to constructor method:

const camera = new Raspistill({
    verticalFlip: true,
    width: 800,
    height: 600
});

See full options list in the docs below.

##Changelog

####v 0.0.9 Fixed some issues with width/height options. Added setDefaultOptions method. Updated some dependencies.

####v 0.0.8 Added noPreview option.

##Docs ###Raspistill

constructor(options?: ICameraOptions)

Creates new Raspistill instance.

Options - object, that can contain:

keytypedefaultsdesc
verticalFlipbooleanfalse
horizontalFlipbooleanfalse
noPreviewbooleantrueDisables preview window on Pi while taking photo
outputDirstring'./photos'Output directory where photos will be stored
fileNamestringnew Date.now() + file encodingName for photo file
encodingstring'jpg''jpg', 'bpm', 'gif' or 'png'
widthnumberundefinedWidth of taken image in pixels. If width is not set - raspistill uses default max camera sensor resolution width
heightnumberundefinedHeight of taken image in pixels. If height is not set - raspistill uses default max camera sensor resolution height
const camera = new Raspistill({
    verticalFlip: true,
    fileName: 'foo'
});
takePhoto(fileName?: string): Promise<Buffer>

Takes new photo. Returns Promise, resolving with Buffer object.

camera.takePhoto('testPhotoName').then((photo) => {
    ...
});
setOptions(options: ICameraOptions): void

Sets new options for current Raspistill instance.

camera.setOptions({
    horizontalFlip: true,
    noPreview: false
});
setDefaultOptions(): void

Reverts all option values of current Raspistill instance to default. Default values are presented in the options table.

getOptions(): ICameraOptions

Gets current raspistill options.

getOption(key: string): any

Gets current raspistill option by key.

Keywords

FAQs

Package last updated on 04 Mar 2017

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