Repository: sjmelia/electron-boilerplate-sqlite
Branch: master
Commit: 0073d097b086
Files: 5
Total size: 3.3 KB
Directory structure:
gitextract_ge1s6pv5/
├── .gitignore
├── README.md
├── app/
│ ├── app.js
│ └── index.html
└── package.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*.swp
build
node_modules
dist
npm-debug.log
================================================
FILE: README.md
================================================
# electron-boilerplate-sqlite
Truly tiny boilerplate for an Electron app that includes SQLite support. See the [blog post](http://blog.arrayofbytes.co.uk/?p=379) for more.
```
git clone https://github.com/sjmelia/electron-boilerplate-sqlite.git
cd electron-boilerplate-sqlite
npm install
npm start
```
## Building a release package
Releases can only be built on the target platform.
`npm run release`
## Using native modules
If you wish to use native modules, you must run `npm run postinstall` after first install of the module.
## Thanks to...
* Primary inspiration: https://github.com/szwacz/electron-boilerplate
* SQLite JS: https://github.com/bytheway/electron-sqlite3/
================================================
FILE: app/app.js
================================================
const electron = require('electron');
const app = electron.app;
var BrowserWindow = electron.BrowserWindow;
let mainWindow;
app.on('window-all-closed', function () {
app.quit();
});
// This method will be called when Electron has done everything
// initialization and ready for creating browser windows.
app.on('ready', function () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
});
// and load the index.html of the app.
mainWindow.loadURL('file://' + __dirname + '/index.html');
// Open the DevTools.
mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
});
================================================
FILE: app/index.html
================================================
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>electron-boilerplate-sqlite</h1>
<ul id="database">
</ul>
<script>
var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(':memory:');
db.serialize(function() {
db.run("CREATE TABLE lorem (info TEXT)");
var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
for (var i = 0; i < 10; i++) {
stmt.run("Ipsum " + i);
}
stmt.finalize();
var rows = document.getElementById("database");
db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
var item = document.createElement("li");
item.textContent = "" + row.id + ": " + row.info;
rows.appendChild(item);
});
});
db.close();
</script>
</body>
</html>
================================================
FILE: package.json
================================================
{
"name": "electron-boilerplate-sqlite",
"productName": "Electron boilerplate with sqlite",
"description": "Starter for your electron + sqlite application",
"version": "1.0.0",
"author": "Kolley Kibber <kolley.kibber@example.com>",
"copyright": "© 2016, Kibber Ltd.",
"homepage": "http://example.com",
"license": "MIT",
"main": "app/app.js",
"build": {
"appId": "com.example.electron-boilerplate-sqlite",
"files": [
"app/**/*",
"node_modules/**/*",
"package.json"
]
},
"scripts": {
"postinstall": "install-app-deps",
"start": "electron .",
"test": "echo \"Error: no test specified\" && exit 1",
"release": "build"
},
"dependencies": {
"sqlite3": "^4.0.9"
},
"devDependencies": {
"electron": "^5.0.6",
"electron-builder": "^21.0.15"
}
}
gitextract_ge1s6pv5/ ├── .gitignore ├── README.md ├── app/ │ ├── app.js │ └── index.html └── package.json
Condensed preview — 5 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4K chars).
[
{
"path": ".gitignore",
"chars": 44,
"preview": "*.swp\nbuild\nnode_modules\ndist\nnpm-debug.log\n"
},
{
"path": "README.md",
"chars": 685,
"preview": "# electron-boilerplate-sqlite\n\nTruly tiny boilerplate for an Electron app that includes SQLite support. See the [blog po"
},
{
"path": "app/app.js",
"chars": 983,
"preview": "const electron = require('electron');\n\nconst app = electron.app;\n\nvar BrowserWindow = electron.BrowserWindow;\n\nlet mainW"
},
{
"path": "app/index.html",
"chars": 844,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n </head>\n <body>\n <h1>electron-boilerplate-sqlite</h1>\n <ul id=\"database\">\n <"
},
{
"path": "package.json",
"chars": 828,
"preview": "{\n \"name\": \"electron-boilerplate-sqlite\",\n \"productName\": \"Electron boilerplate with sqlite\",\n \"description\": \"Starte"
}
]
About this extraction
This page contains the full source code of the sjmelia/electron-boilerplate-sqlite GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 5 files (3.3 KB), approximately 1.0k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.