Skip to content

Commit

Permalink
feat: Bump npm dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Sep 16, 2019
1 parent 4fc5238 commit 5e59e5a
Show file tree
Hide file tree
Showing 31 changed files with 8,058 additions and 8,346 deletions.
5 changes: 1 addition & 4 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"concurrent": true,
"linters": {
"*.ts": [
"src/**/*.ts": [
"prettier --parser typescript --write",
"git add"
]
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ You have several options to get your image:
1) Use `.save(filename)` of `.saveAsync(filename)` methods, that will save the image to your filesystem.
2) Use `.getDataAndSizeAsync('binary' | 'base64')` method, which returns following object:

```typescript
```
{
data: data, // Buffer for binary format and string for base64.
size: size
Expand Down
5 changes: 2 additions & 3 deletions examples/abilities-list.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { checkCode } = require('../src/driver');
const { AbilitiesList, PortInfoList, GPhoto2Driver } = require('../src');
const { AbilitiesList, PortInfoList, GPhoto2Driver, checkCode } = require('@typedproject/gphoto2-driver');
// If you launch this example not from library folder, change the previous two lines to:
// const { checkCode } = require('@typedproject/gphoto2-driver/driver');
// const { AbilitiesList, PortInfoList, GPhoto2Driver } = require('@typedproject/gphoto2-driver');
Expand Down Expand Up @@ -30,4 +29,4 @@ for (let i = 0; i < size; i++) {
}

abilitiesList.close();
portList.close();
portList.close();
2 changes: 1 addition & 1 deletion examples/camera-abilities.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Camera, closeQuietly, GPPortType, GPCameraDriverStatus, GPCameraFileOperation, GPCameraFolderOperation, GPDeviceType } = require('../src');
const { Camera, closeQuietly, GPPortType, GPCameraDriverStatus, GPCameraFileOperation, GPCameraFolderOperation, GPDeviceType } = require('@typedproject/gphoto2-driver');
// If you launch this example not from library folder, change the previous line to:
// const { Camera, closeQuietly, GPPortType, GPCameraDriverStatus, GPCameraFileOperation, GPCameraFolderOperation, GPDeviceType } = require('@typedproject/gphoto2-driver');
const camera = new Camera();
Expand Down
2 changes: 1 addition & 1 deletion examples/camera-autoselect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Camera, closeQuietly } = require('../src');
const { Camera, closeQuietly } = require('@typedproject/gphoto2-driver');
// If you launch this example not from library folder, change the previous line to:
// const { Camera, closeQuietly } = require('@typedproject/gphoto2-driver');
const path = require('path');
Expand Down
2 changes: 1 addition & 1 deletion examples/camera-info.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const SegfaultHandler = require('segfault-handler');
const path = require('path');
const { CameraList, closeQuietly } = require('../src');
const { CameraList, closeQuietly } = require('@typedproject/gphoto2-driver');
// If you launch this example not from library folder, change the previous line to:
// const { CameraList, closeQuietly } = require('@typedproject/gphoto2-driver');

Expand Down
4 changes: 2 additions & 2 deletions examples/camera-list-autodetect.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const SegfaultHandler = require('segfault-handler');
const { CameraList, PortInfoList } = require('../src');
const { CameraList, PortInfoList } = require('@typedproject/gphoto2-driver');
// If you launch this example not from library folder, change the previous line to:
// const { CameraList, PortInfoList } = require('@typedproject/gphoto2-driver');

Expand All @@ -23,4 +23,4 @@ cameraList.toArray().forEach((cameraInfo, index) => {
console.log(`[Cam.${index}] portInfo =>`, portInfo.path);
});

cameraList.close();
cameraList.close();
4 changes: 2 additions & 2 deletions examples/camera-list-populate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const SegfaultHandler = require('segfault-handler');
const { CameraList, PortInfoList } = require('../src');
const { CameraList, PortInfoList } = require('@typedproject/gphoto2-driver');
// If you launch this example not from library folder, change the previous line to:
// const { CameraList, PortInfoList } = require('@typedproject/gphoto2-driver');

Expand All @@ -20,4 +20,4 @@ cameraList.toArray().forEach((cameraInfo, index) => {
});

cameraList.close();
portList.close();
portList.close();
2 changes: 1 addition & 1 deletion examples/camera-liveview-file.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This example illustrates the usecase, where you need to capture liveview from the camera
// and then save it to .mjpg file. The file will be updated in live mode.

const { Camera } = require('../src');
const { Camera } = require('@typedproject/gphoto2-driver');
// If you launch this example not from library folder, change the previous two lines to:
// const { Camera } = require('@typedproject/gphoto2-driver');
const path = require('path');
Expand Down
4 changes: 2 additions & 2 deletions examples/camera-liveview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// node examples/camera-liveview.js | xxd | grep ffd9
// if you see a lot of ffd9 (not in the first column) - then it works

const { Camera } = require('../src');
const { Camera } = require('@typedproject/gphoto2-driver');
// If you launch this example not from library folder, change the previous two lines to:
// const { Camera } = require('@typedproject/gphoto2-driver');
const camera = new Camera();
Expand Down Expand Up @@ -47,4 +47,4 @@ setTimeout(() => {

camera.closeQuietly(); // Do not forget to close camera
}, NUMBER_OF_SECONDS_TO_LISTEN * 1000);
}, (NUMBER_OF_SECONDS_TO_WAIT + NUMBER_OF_SECONDS_TO_LISTEN) * 1000)
}, (NUMBER_OF_SECONDS_TO_WAIT + NUMBER_OF_SECONDS_TO_LISTEN) * 1000)
4 changes: 2 additions & 2 deletions examples/camera-scenario-async.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Camera, closeQuietly, CameraWidgets } = require('../src');
const { Camera, closeQuietly, CameraWidgets } = require('@typedproject/gphoto2-driver');
// If you launch this example not from library folder, change the previous line to:
// const { Camera, closeQuietly, CameraWidgets } = require('@typedproject/gphoto2-driver');

Expand Down Expand Up @@ -97,4 +97,4 @@ function runCapture() {
.then(() => {
console.log('File saved on', filePath);
});
}
}
46 changes: 23 additions & 23 deletions examples/camera-scenario.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const { Camera, closeQuietly, CameraWidgets } = require('../src');
const {Camera, closeQuietly, CameraWidgets} = require("@typedproject/gphoto2-driver");
// If you launch this example not from library folder, change the previous line to:
// const { Camera, closeQuietly, CameraWidgets } = require('@typedproject/gphoto2-driver');

const path = require('path');
const path = require("path");

const camera = new Camera();

try {
console.log('[GPDRIVER] Camera init');
console.log("[GPDRIVER] Camera init");
camera.initialize();

runScenario({
Expand All @@ -22,53 +22,53 @@ try {
closeQuietly(camera);
}

function runScenario({ autoFocus = false, preview = false, capture = false, triggerCapture = false }) {
console.log('[GPDRIVER] Camera Loaded');
function runScenario ({autoFocus = false, preview = false, capture = false, triggerCapture = false}) {
console.log("[GPDRIVER] Camera Loaded");

try {
if (autoFocus) {
console.log('[GPDRIVER] Autofocus =============================');
console.log("[GPDRIVER] Autofocus =============================");
runAutofocus();
}
} catch (er) {
console.warn('Autofocus fail', er.message);
console.warn("Autofocus fail", er.message);
}

try {
if (preview) {
console.log('[GPDRIVER] Preview ===============================');
console.log("[GPDRIVER] Preview ===============================");
runPreview();
}
} catch (er) {
console.warn('Preview fail', er.message);
console.warn("Preview fail", er.message);
}

try {
if (triggerCapture) {
console.log('[GPDRIVER] Trigger Capture =======================');
console.log("[GPDRIVER] Trigger Capture =======================");
runTriggerCapture();
}
} catch (er) {
console.warn('triggerCapture fail', er.message);
console.warn("triggerCapture fail", er.message);
}

try {
if (capture) {
console.log('[GPDRIVER] Capture ===============================');
console.log("[GPDRIVER] Capture ===============================");
runCapture();
}
} catch (er) {
console.warn('capture fail', er.message);
console.warn("capture fail", er.message);
}

}

/**
*
*/
function runAutofocus() {
function runAutofocus () {
try {
camera.widgets.get('/actions/autofocusdrive').value = true;
camera.widgets.get("/actions/autofocusdrive").value = true;
} catch (er) {
console.warn(er);
}
Expand All @@ -77,25 +77,25 @@ function runAutofocus() {
/**
*
*/
function runPreview() {
const filePath = path.join(__dirname, '../.tmp/preview.jpg');
function runPreview () {
const filePath = path.join(__dirname, "../.tmp/preview.jpg");
camera.capturePreview(filePath);
console.log('File saved on', filePath);
console.log("File saved on", filePath);
}

/**
*
*/
function runTriggerCapture() {
function runTriggerCapture () {
camera.triggerCapture();
}

/**
*
*/
function runCapture() {
const filePath = path.join(__dirname, '../.tmp/capture.jpg');
function runCapture () {
const filePath = path.join(__dirname, "../.tmp/capture.jpg");

camera.captureImage(filePath);
console.log('File saved on', filePath);
}
console.log("File saved on", filePath);
}
2 changes: 1 addition & 1 deletion examples/camera.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const SegfaultHandler = require('segfault-handler');
const path = require('path');
const { CameraList, closeQuietly } = require('../src');
const { CameraList, closeQuietly } = require('@typedproject/gphoto2-driver');
// If you launch this example not from library folder, change the previous line to:
// const { CameraList, closeQuietly } = require('@typedproject/gphoto2-driver');

Expand Down
Loading

0 comments on commit 5e59e5a

Please sign in to comment.