
Security News
Python Adopts Standard Lock File Format for Reproducible Installs
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
@cantoo/cantoo-client
Advanced tools
This package will help you make your app compatible with Cantoo Scribe.
Add the package to your project:
npm install cantoo@cantoo-client
Alternatively, you can download the latest version here, but you will have to manually update it when needed.
Then, you will have to create a CantooClient instance:
const CantooClient = require('cantoo@cantoo-client')
const cantoo = new CantooClient()
Now, here are the main instructions that you will have to handle:
The methods that you should call:
When the app is ready, you must call this method.
initMyApp().then(() => cantoo.loaded())
Cantoo Scribe needs to be aware when a change is available in your app. Call this method each time a change occurs that the user might want to save. Be aware that an internal debounce will happen to avoid flood, so don't worry about it.
doSomethingThatWillUpdateTheState()
cantoo.updated()
When you want to clear all listeners set and free the memory hold by the CantooClient object, call the destroy()
method.
cantoo.destroy()
Cantoo Scribe sometimes needs the current document. You need to register a listener to that event, and it should return a string containing the data you would need to recreate the document, and an image (svg or png) that can best represent the current work of the user.
const generateDocument = async () => {
return {
doc: await gatherTheDataOfMyApp()
svg: await generatePicture()
}
}
cantoo.onDocumentRequest(generateDocument)
Cantoo Scribe might ask your app to clean up and be ready to generate a new document. Don't worry, the user would have had the chance to save the data if they needed to. There is nothing else to do but to clear the current document state.
const clearAll = async () => {
// Don't forget to await, or to return a promise so Cantoo Scribe knows when the document is ready
await flush()
}
cantoo.onClearRequest(clearAll)
Cantoo Scribe might ask your app to load a new document. You will receive, as a string, the document data you provided in the onDocumentRequest
method. This is your responsability to maintain retro-compatibility of those data accross versions of your app.
const loadDocument = async (data: string) => {
// Don't forget to await, or to return a promise so Cantoo Scribe knows when the document is ready
await loadTheDataInTheApp(data)
}
cantoo.onLoadDocumentRequest(loadDocument)
Method | Parameters | Return value | Description |
---|---|---|---|
loaded | void | void | Call this method when the app is ready and fully loaded |
changed | void | void | Call this method each time your app state changed and would now be represented by a different document. This will be used to indicate the user that new data need saving |
destroy | void | void | Call this method when you want to free the memory and remove the listeners |
Method | Event | Return value | Description |
---|---|---|---|
onDocumentRequest | void | Promise< | Cantoo Scribe needs to save the current document. Provide a method that will return the data you will need to reconstruct the current state of your app, and an illustration for the user, as png or svg. |
onClearRequest | void | Promise<void> | Cantoo Scribe wants to reset the document. Provide a method that will clear the current state. |
onLoadDocumentRequest | void | Promise<void> | Cantoo Scribe want to load the provided data into your app. Provide a method that will take that data and load it. |
FAQs
A client for integration inside Cantoo Scribe
The npm package @cantoo/cantoo-client receives a total of 2 weekly downloads. As such, @cantoo/cantoo-client popularity was classified as not popular.
We found that @cantoo/cantoo-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
Security News
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.