JavaScript Code Parts
npm install @standard-software/parts- Node.js
- Deno
- Major Web Browser
- Chrome
- Edge
- firefox
- Opera
- Vivaldi
- IE11
- Google Apps Script
- Google SpreadSheet
- V8
- Rhino
- Windows Scripting Host (WSH)
- revive support wsh Parts.js ver 10.x after
- not support wsh Parts.js ver 6.x / 9.x
- support wsh Parts.js ver 8.x / 7.x / 5.x before
Normal
npm i @standard-software/parts
When specifying the version
npm i @standard-software/parts@10.7.0
npm i @standard-software/parts@9.2.0
``js
// index.js
const parts = require("@standard-software/parts");
console.log(
'parts version is ', parts.VERSION
);
`
node index.js
`js
// index.mjs
import parts from '@standard-software/parts';
console.log(
'parts version is ', parts.VERSION
);
`
node --experimental-modules index.mjs
- partsjs/run_check/node_release/
- partsjs/test/build/
`js
// index.js
import parts from './source/index.js';
console.log(
'parts version is ', parts.VERSION
);
`
deno run index.js
`js
// index.js
import parts from 'https://raw.githubusercontent.com/standard-software/partsjs/v10.7.0/source/index.js';
console.log(
'parts version is ', parts.VERSION
);
`
deno run index.js
- partsjs/run_check/deno_local/
- partsjs/run_check/deno_web/
- partsjs/test/source/
`html`
You can now use the functions of the parts.js object.
`html`
You can now use the functions of the parts.js object.
- partsjs/run_check/html/
- partsjs/test/release/web/
- partsjs/docs/test/web/test.html
https://standard-software.github.io/partsjs/test/web/test.html
- partsjs/docs/test/web-cdn/test.html
https://standard-software.github.io/partsjs/test/web-cdn/test.html
https://npm.runkit.com/%40standard-software%2Fparts
`js`
var parts = require("@standard-software/parts")
console.log('parts version is ', parts.VERSION);
https://jsbin.com/popuhog/edit?html,js,console
`html
`
`js`
console.log('parts version is ' + parts.VERSION)
https://script.google.com/home
- input name for example [parts.js test]
- menu [file][new][script file]
- input [parts] and created parts.gs file
- Please copy and paste ./release_build/parts.js to parts.gs
- project
- code.gs
- parts.gs
`js`
// code.gs
function myFunction() {
console.log('parts version is ' + parts.VERSION);
}
You can now use the functions of the parts.js object.
To see console.log execution results
Google Apps Script Home
[parts.js test][run count][my function]
- menu [view][show manifest file]
update manifest file
`json`
// appsscript.json
{
"timeZone": "Asia/Tokyo",
"dependencies": {
},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8"
}
`js`
// code.gs
function myFunction() {
outputFunction = () => {
return 'parts version is ' + parts.VERSION
}
console.log(outputFunction());
}
V8 engine support arrow function.
You can now use the functions of the parts.js object.
same [How to use Google Apps Script]
- spreadsheet menu [tool][script editor]
open google apps script project
- input name for example [SpreadSheets parts.js test]
- menu [file][new][script file]
- input [parts]
- created parts.gs
You can copy and paste ./release_build/parts.js code into parts.gs
- project
- code.gs
- parts.gs
`js`
// code.gs
function myFunction() {
console.log('parts version is ' + parts.VERSION);
Browser.msgBox('parts version is ' + parts.VERSION);
}
run and see sheet page.
more write add code.gs
`js
function onOpen() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var entries = [
{
name : "execute myFunction",
functionName : "myFunction"
}
];
sheet.addMenu("run script", entries);
};
function myFunction() {
console.log('parts version is ' + parts.VERSION);
Browser.msgBox('parts version is ' + parts.VERSION);
}
`
- spreadsheet menu [run script]execute myFunction]
same [How to use Google Apps Script]
- partsjs/run_check/wsh/
- partsjs/test/release/wsh/
`html
``
You can now use the functions of the parts.js object.