Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saitolume/clipstudio.js
📎 A JavaScript library for using CLIP STUDIO .clip file on browsers and Node.js
https://github.com/saitolume/clipstudio.js
clipstudio illustration nodejs typescript
Last synced: 13 days ago
JSON representation
📎 A JavaScript library for using CLIP STUDIO .clip file on browsers and Node.js
- Host: GitHub
- URL: https://github.com/saitolume/clipstudio.js
- Owner: saitolume
- License: mit
- Created: 2020-02-23T16:14:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T08:05:36.000Z (almost 2 years ago)
- Last Synced: 2024-06-01T07:09:38.851Z (6 months ago)
- Topics: clipstudio, illustration, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 77.8 MB
- Stars: 27
- Watchers: 1
- Forks: 2
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clipstudio.js
A JavaScript library for using CLIP STUDIO .clip file on browsers and Node.js
## Installation
```bash
$ yarn add clipstudio # or npm install clipstudio
```## Usage
Browsers
```ts
import { ClipStudio } from 'clipstudio'const inputFile = event => {
const [file] = event.target.files
const clip = await ClipStudio.load(file)const thumbnail = clip.getThumbnail() // Blob
const layers = clip.getLayers() // Layer[]
}
```Node.js
```ts
import { ClipStudio } from 'clipstudio'
import { promises as fs } from 'fs'const file = await fs.readFile('path/to/clip-file')
const clip = await ClipStudio.load(file)const thumbnail = clip.getThumbnail() // Buffer
const layers = clip.getLayers() // Layer[]
/*
[
{
id: '5f8f2d2381-7a44-f2a9-dfa6-51417dd5ad',
index: 1,
name: '',
opacity: 1,
isVisible: true,
isFolder: false
},
...
]
*/
```## API
### ClipStudio.load(file: File | Buffer): Promise\
Returns Promise of ClipStudio instance to use .clip file.
### ClipStudio.getThumbnail(): Blob | Buffer
Returns thumbnail image data of .clip file.
### ClipStudio.getLayers(): Layer[]
Returns layers array.
### Layer
```ts
{
id: string // uuid
index: number
name: string
opacity: number
isVisible: boolean
isFolder: boolean
}
```## License
MIT