{"_id":"@asdine/genji","_rev":"4-7306b855a25286be1a0aad76a1740876","time":{"0.1.0-beta":"2020-04-09T12:52:27.801Z","created":"2020-04-09T12:54:08.796Z","0.1.0-alpha":"2020-04-09T12:54:09.176Z","modified":"2022-04-04T15:44:23.877Z"},"name":"@asdine/genji","dist-tags":{"develop":"0.1.0-alpha","latest":"0.1.0-alpha"},"versions":{"0.1.0-alpha":{"version":"0.1.0-alpha","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","repository":{"type":"git","url":"git@github.com:asdine/genji.js.git"},"module":"src/index.js","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","wasm":"cd ./src/bindings && GOOS=js GOARCH=wasm go build -o ../../dist/genji.wasm","prepare":"yarn run wasm","prepublish":"tsdx build","postbuild":"yarn run wasm"},"peerDependencies":{},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"name":"@asdine/genji","author":{"name":"Asdine El Hrychy"},"description":"Document-oriented, embedded, SQL database","devDependencies":{"@types/jest":"^25.2.1","husky":"^4.2.3","tsdx":"^0.13.1","tslib":"^1.11.1","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Asdine El Hrychy\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@asdine/genji@0.1.0-alpha","dist":{"shasum":"b8627325fca3b93692d5fa6015f88ca037bcf3fa","integrity":"sha512-XpEUbZ5kEhxMdVFJX9LdqbeK/p4cPWE4NIP+wneUTpSW+iQqppc5yaLTuu376uqgUrA45lQAW0WpsYTRZAR+DQ==","tarball":"https://registry.npmjs.org/@asdine/genji/-/genji-0.1.0-alpha.tgz","fileCount":28,"unpackedSize":3644389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejxrxCRA9TVsSAnZWagAAhr8P/0Y/Lh1wMCm4ZMTVSVLU\nXiVfhJ05T095n9NvMa/5mj3tnugFCgTVyzVQEtHm/VVzt0UP+B0zabwwxu15\nd+TPqd7fGLXqxHgBwrkDENanaAju6kR82zZ0ewA3jIuOBh4T9G/hoYSUnmk8\nXJiBDdXltMwHY7BZBQL1nLQBETia5p6fXGoLm5eubDzKIdiUZfdvVc/xUIPu\nq5I2sWIJ9PLBC5kVyNwA0qxtdlhhPnG+cZjqu4zRihqBZ09HFA54f3B/VQIA\noDFW6kf6SYIOUWohgqzf7Lg4hhq5Ap+8AANRcUJvNHeKBTvIxWVASQ/92x2X\nz5rT7e1QSjzGK0+tcKO7HXTHO3ZE96TEheB4+WvHlex89rx+HPXDHRMgX7Z+\nn38L+4tRlc40ayUooc6NiPUvbYDpabJh1WYkmu0fO54RVDxLpV5MwEDd9UDw\n2n7kyFAINPsXcavQam6B235hhQ/eCnz/GJPIooatox1dawuHWAu8J6Q8uv+/\n6f5tjRozdFXDitnQsGVWirdOcnW5ZpPY8Ie81d/Qe+gW+oxbGj0n2O3DJ6n9\nS3qc5H7dWwuWZkv8fOkbMv/LvBOOm933tArmmDtYrdumzGnzUwok0057D7m+\nM3WRQy+ZymHHi2YoCezM1Nr/LaRPM7uvf6M/M85W2EYr+hg8AQ8Fl7GA2B5h\n7llG\r\n=Qnxx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICVVK4N7ZT0rebCMCm90vE/K/vMYGVXqKDXmTKW0kuvOAiEA7p5Siio4C3lM9wIi3mJK4ik1X+gfeNp2XW401xIwVdE="}]},"maintainers":[{"name":"asdine","email":"asdine.elhrychy@gmail.com"}],"_npmUser":{"name":"asdine","email":"asdine.elhrychy@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/genji_0.1.0-alpha_1586436849030_0.9946073839362004"},"_hasShrinkwrap":false}},"maintainers":[{"name":"asdine","email":"asdine.elhrychy@gmail.com"}],"description":"Document-oriented, embedded, SQL database","repository":{"type":"git","url":"git@github.com:asdine/genji.js.git"},"author":{"name":"Asdine El Hrychy"},"license":"MIT","readme":"<h1 align=\"center\"> Genji.js </h1>\n<p align=\"center\">\n  <a href=\"https://genji.dev\">\n    <img alt=\"Genji\" title=\"Genji\" src=\"https://raw.githubusercontent.com/asdine/genji/master/docs/assets/icons/logo.svg?sanitize=true\" width=\"100\">\n  </a>\n</p>\n\n<p align=\"center\">\n  Document-oriented, embedded, SQL database\n</p>\n\nExperimental wrapper around the [Genji](https://github.com/asdine/genji) database.\n\nIt's functional but, currently, the compiled WebAssembly file is too big (~3mb) to be objectively usable in production.\n\nThe code is compatible with [TinyGo](https://github.com/tinygo-org/tinygo) and produces a 400kb wasm file but there are too many bugs in the v0.12.0, I will wait for the next version to give a try.\n\n## Getting started\n\nInstall Genji\n\n```bash\nyarn add @asdine/genji\n```\n\nCopy the wasm file from `node_modules` into your public directory\n\n```bash\ncp node_modules/@asdine/genji/genji.wasm public/\n```\n\nOr if you are using Webpack, add this to your config, after installing the `copy-webpack-plugin` loader :\n\n```bash\nyarn add --dev copy-webpack-plugin\n```\n\n```javascript\nconst CopyWebpackPlugin = require('copy-webpack-plugin');\n\nmodule.exports = {\n    ...\n    plugins: [\n        new CopyWebpackPlugin([\n            { from: 'node_modules/@asdine/genji/dist/genji.wasm' }\n        ])\n    ]\n}\n```\n\n## Usage\n\n```javascript\nimport { initDatabase } from '@asdine/genji';\n\nasync function run() {\n    const genji = await initDatabase();\n    const db = await genji.Database();\n    await db.exec(\"CREATE TABLE foo\");\n    await db.exec(\"INSERT INTO foo (a) VALUES (1), (2), (3)\");\n\n    db.query(\"SELECT * FROM foo\").\n        forEach((v) => console.log(v));\n}\n\nrun()\n```\n\n## Build from source\n\nRequires [Go](https://golang.org/dl/) >= 1.13 and [Node](https://nodejs.org/en/download/) >= 10\n\n```bash\nyarn install\nyarn build\n```\n\n## Running tests\n\n```bash\nyarn test\n```\n","readmeFilename":"README.md"}