Package your kintone plugin with pure JavaScript

!Node.js version
!License
kintone plugin package.sh in JavaScript
It's written in pure JavaScript, so
- The CLI works with Node.js in Mac/Windows/Linux
- The web page works in any modern browsers
- Validate your manifest.json with JSON Schema
``console`
$ npm install -g @kintone/plugin-packer
`console`
$ kintone-plugin-packer [OPTIONS] PLUGIN_DIR
- --ppk PPK_FILE: The path of input private key file. If omitted, it is generated automatically into in the same directory of PLUGIN_DIR or --out if specified.--out PLUGIN_FILE
- : The path of generated plugin file. The default is plugin.zip in the same directory of PLUGIN_DIR.--watch
- , -w: Watch PLUGIN_DIR for the changes.
If your private key is ./private.ppk and the plugin directory is ./plugin, edit package.json:
`json`
{
"scripts": {
"package": "kintone-plugin-packer --ppk private.ppk plugin"
}
}
and then
`console`
$ npm run package
`js
const packer = require("@kintone/plugin-packer");
const fs = require("fs");
const buffer = createContentsZipBufferInYourSelf();
packer(buffer).then((output) => {
console.log(output.id);
fs.writeFileSync("./private.ppk", output.privateKey);
fs.writeFileSync("./plugin.zip", output.plugin);
});
``
MIT License