Welcome to Ghost Writer !
Ghost Writer is an offline management application for personal notes and documents developed with reference to 觅道(MrDoc).
Is a pure front-end project, the use of sqlite local database, in addition to self-editing to use external images, external videos, external links and other resources, as well as OCR recognition interface, registration, login, editing and other functions do not use the network, data stored in the application's local resource folder, fully guaranteed data privacy, private.
Default administrator account admin
Password admin123..
sql.js is hosted on npm. You can install it by running npm install sql.js
. Alternatively, you can download sql-wasm.js
and sql-wasm.wasm
to implement the function.
var fs = require('fs');
var initSqlJs = require('sql-wasm.js');
var filebuffer = fs.readFileSync('test.sqlite');
initSqlJs().then(function(SQL){
// Load the db
var db = new SQL.Database(filebuffer);
});
You need to convert the result of db.export
to buffer
var fs = require("fs");
// [...] (create the database)
var data = db.export();
var buffer = new Buffer(data);
fs.writeFileSync("filename.sqlite", buffer);
npm install
cnpm install
It is recommended to use the command electron-builder install-app-deps
before packaging with electron-builder
.
This command is used to compile the native module for the node version corresponding to the electron
program to be packaged, so as to achieve module runtime matching.
In fact, the node-gyp
knowledge is still used inside install-app-deps.
If an error occurs during the install phase, you can first put "postinstall":"electron-builder install-app-deps",
and"postuninstall":"electron-builder install-app-deps"
delete and execute.
When cnpm install
/npm install
, an error is reported: RunScriptError: Run "C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild"
Run powershell with administrator privileges, install cnpm install --global --production windows-build-tools
, and add C:\Users\username\.windows-build-tools\python27
to the configuration environment variable path
npm run dev
npm run electron:build
When you are prompted cannot find module fs/promises
, find the dependent file according to the error location, replace all require("fs/promises")
with require("fs").promises
, and then package.
# The first step to clean up the npm cache:
npm cache clean -f
# Step 2 Run the npm installer
npm -g install n
# Step 3 Run n stable(install the latest stable version)
n stable
# Step 1 Remove the installed CNPM version
npm uninstall -g cnpm
# Step 2: Install a lower version of cnpm
npm install cnpm@7.1.0 -g --registry=https://registry.npm.taobao.org
Ctrl + F12
Open the console