fb661b750029eb41c4eadd6659ca719afb630340
* YOYO NEW API SPEC! * update apiGen * update mass test * Generated new lib * 2d conversion update * Generated new lib Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
KittyCAD JS/TS API library
Socials:: - blog • twitter • linkedin • instagram • youtube • discord
Fully typed js library, compatible with js and ts.
Full documentation here
Simple example below.
Install
npm install @kittycad/lib
# or
yarn add @kittycad/lib
## set your token
export KITTYCAD_TOKEN=<your token>
Basic example
import { file } from '@kittycad/lib';
import fsp from 'fs/promises';
async function main() {
// kittycad.io/docs/api/get-cad-file-mass?lang=typescript
const response = await file.create_file_mass({
src_format: 'obj',
material_density: '0.007',
body: await fsp.readFile('./example.obj', 'base64'),
})
if ('error_code' in response) throw response
const { status, mass } = response
console.log(status, mass);
}
main();
Languages
TypeScript
99.3%
Go
0.2%
Nix
0.2%
JavaScript
0.2%
Shell
0.1%
