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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@raydotac/ftpkeyence

v1.0.2

Published

FTP client for Keyence VS series vision cameras. Supports list, download, upload, remove — file and folder — with TypeScript types.

Readme

ftpkeyence

FTP client for Keyence VS series vision cameras. Written in TypeScript with full type definitions.

Supports listing, downloading, uploading, and removing files/folders on camera internal (EM) and SD card (SD) storage.

Install

npm install @raydotac/ftpkeyence

Camera Configuration

Before using, make sure the FTP server on the camera is accessible:

| Setting | Default | Where to find / set | |---------|---------|---------------------| | ip |  E| Camera IP address (required) | | ftpPort | 21 | 環墁E��宁EↁEFTP設宁E| | ftpUser | "Admin" | VS Creator title bar shows logged-in user | | ftpPass | "" | Empty by default  Eset in VS Creator if needed |

Storage paths on the camera:

| Path | Description | |------|-------------| | /EM/VS/Camera/Programs | Internal storage  Eprograms | | /SD/VS/Camera/Programs | SD card  Eprograms | | /EM/VS/Camera/Image | Internal storage  Ecaptured images | | /SD/VS/Camera/Image | SD card  Ecaptured images |

Note: The camera FTP server rejects LIST -a. This library uses MLSD internally to work around this.


TypeScript / JavaScript Usage

Basic setup

import { FtpKeyence } from '@raydotac/ftpkeyence';

const camera = new FtpKeyence({
  ip: '192.168.1.86',     // required
  ftpPort: 21,            // optional, default 21
  ftpUser: 'Admin',       // optional, default 'Admin'
  ftpPass: '',            // optional, default ''
});

List a directory

await camera.connect();

const items = await camera.list('/EM/VS/Camera/Programs');

for (const item of items) {
  if (item.isDirectory) {
    console.log(`📁 ${item.name}  ${item.modifyDate}`);
  } else {
    console.log(`📄 ${item.name}  ${item.size} bytes  ${item.modifyDate}`);
  }
}

camera.close();

Download a file

await camera.connect();

await camera.downloadFile(
  '/EM/VS/Camera/Programs/StartupProgram.stp',
  './downloads/StartupProgram.stp'
);

camera.close();

Download a folder (recursive)

await camera.connect();

await camera.downloadFolder(
  '/EM/VS/Camera/Programs/0610_63331-731-53U00',
  './downloads/0610_63331-731-53U00',
  (remotePath, localPath) => {
    console.log(`Downloaded: ${remotePath}`);
  }
);

camera.close();

Upload a file

await camera.connect();

await camera.uploadFile(
  './local/myprogram.vsm',
  '/SD/VS/Camera/Programs/myprogram.vsm'
);

camera.close();

Upload a folder (recursive)

await camera.connect();

await camera.uploadFolder(
  './local/myprogram',
  '/SD/VS/Camera/Programs/myprogram',
  (localPath, remotePath) => {
    console.log(`Uploaded: ${localPath}`);
  }
);

camera.close();

Remove a file or folder (auto-detected)

await camera.connect();

// Remove a file
await camera.remove('/EM/VS/Camera/Programs/StartupProgram.stp');

// Remove an entire folder recursively
await camera.remove(
  '/EM/VS/Camera/Programs/old_program',
  (itemPath, type) => {
    console.log(`Deleted [${type}]: ${itemPath}`);
  }
);

camera.close();

Monitor for new images (auto-download)

import { FtpKeyence } from '@raydotac/ftpkeyence';
import * as fs from 'fs';
import * as path from 'path';

const camera = new FtpKeyence({ ip: '192.168.1.86' });
const known: Record<string, string> = {};
const OUT_DIR = './images';

async function poll() {
  const items = await camera.list('/EM/VS/Camera/Image');

  for (const item of items) {
    if (!item.isFile) continue;

    const key = item.name;
    if (!known[key] || known[key] !== item.modifyRaw) {
      known[key] = item.modifyRaw;

      // New or updated image  Edownload it
      const localPath = path.join(OUT_DIR, item.name);
      await camera.connect();
      await camera.downloadFile(`/EM/VS/Camera/Image/${item.name}`, localPath);
      camera.close();

      console.log(`Downloaded: ${item.name}`);
    }
  }
}

// Initial scan without downloading
const initial = await camera.list('/EM/VS/Camera/Image');  // standalone list
initial.forEach(i => { known[i.name] = i.modifyRaw; });

// Poll every 3 seconds
setInterval(poll, 3000);

Electron / Vite integration

// In your Electron main process or Node.js backend:
import { FtpKeyence } from '@raydotac/ftpkeyence';

const camera = new FtpKeyence({ ip: '192.168.1.86' });

// Expose to renderer via IPC:
ipcMain.handle('camera:list', async (_, remotePath: string) => {
  await camera.connect();
  const items = await camera.list(remotePath);
  camera.close();
  return items;
});

ipcMain.handle('camera:download', async (_, remotePath: string, localPath: string) => {
  await camera.connect();
  await camera.downloadFile(remotePath, localPath);
  camera.close();
});

API Reference

new FtpKeyence(config)

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | config.ip | string | ✁E| Camera IP address | | config.ftpPort | number |  E| FTP port (default: 21) | | config.ftpUser | string |  E| FTP username (default: "Admin") | | config.ftpPass | string |  E| FTP password (default: "") |

Methods

| Method | Description | |--------|-------------| | connect() | Connect to FTP server | | close() | Disconnect | | list(remotePath) | List directory ↁEFtpItem[] | | downloadFile(remote, local) | Download single file | | downloadFolder(remote, local, onFile?) | Download folder recursively | | uploadFile(local, remote) | Upload single file | | uploadFolder(local, remote, onFile?) | Upload folder recursively | | remove(remote, onItem?) | Remove file or folder (auto-detected) | | getClient() | Access underlying basic-ftp client |

FtpItem

interface FtpItem {
  name: string;
  isDirectory: boolean;
  isFile: boolean;
  size: number;       // bytes
  modifyRaw: string;  // "YYYYMMDDHHmmss"
  modifyDate: string; // "YYYY-MM-DD HH:mm:ss"
}

CLI Usage

After installing globally (npm install -g @raydotac/ftpkeyence):

ftpkeyence list   /EM/VS/Camera/Programs
ftpkeyence get    /EM/VS/Camera/Programs/0610_63331-731-53U00
ftpkeyence get    /EM/VS/Camera/Programs/StartupProgram.stp  ./local/
ftpkeyence put    ./myprogram   /SD/VS/Camera/Programs/myprogram
ftpkeyence put    ./myfile.vsm  /SD/VS/Camera/Programs/myfile.vsm
ftpkeyence remove /EM/VS/Camera/Programs/old_program

# Custom camera address:
ftpkeyence list /EM/VS/Camera/Programs --ip 192.168.0.10 --user Admin --pass ""

License

MIT