disk-file-writer
TypeScript icon, indicating that this package has built-in type declarations

1.9.0 • Public • Published

disk-file-writer

purpose

  1. Create a local logging system
    • write log into disk files
    • set max size for each log file
    • log rotate
    • keep the log file in a safe disk place where only chrome can access, and provide ways to move it to real folder
  2. Recording a web meeting locally
    • write recorded stream into disk file
    • add multiple audio stream, mix it and write to file

Usage

  • install
npm install disk-file-writer
  • init
import FileLogger from 'disk-file-writer';

FileLogger.createUI();
then we have the UI:

![recording](./images/recording.gif)
  1. choose where to store files img click the choose where to store file button will open the system folder, this is where you choose your root folder to store all the log files and video recording files.
  2. local recoding when you have choose the folder to store file, the choose where to store file button will be removed, then you can click the start recording button, thre browser will ask to select a window/screen/browser tab to record. img the default sub-folder to store recording file is zoomvideos, so you can find the recording here: img
  3. debugging log sometimes we want to open log file and see it updating in real time. we can doing it by simply click the debugging button: img why don't we open the real-time log.txt ? because the file is being open and close every 1s, so we can't see the updated the file content if we keep the file open. so we have to utilize some tools to see it:
    1. in mac, we use
      tail -F path_to_file
      
    2. in windows, we use
      Get-Content path_to_file -Wait -Tail 10
      
  4. request permission we store the root directory handle in indexedDB, so you don't have to re-select the directory handle after page refreshment but that doesn't mean we can use the file handle from indexedDB directly, we need the browser to grant permission of read-write after page refreshment.

Dependents (0)

Package Sidebar

Install

npm i disk-file-writer

Weekly Downloads

2

Version

1.9.0

License

ISC

Unpacked Size

57.3 kB

Total Files

10

Last publish

Collaborators

  • ivan_liuqi