Sleetza
Sleetza7mo ago

Sleetza - Hi all, can anyone tell me where to i...

Hi all, can anyone tell me where to install dependencies / packages so i can use them in custom nodes?
6 Replies
Sleetza
Sleetza7mo ago
Trying to use pdf.js
Gaurav Chadha
Gaurav Chadha7mo ago
Hi @Sleetza, you can import any npm package using Named import declaration. Example: import module from "module-name"; & import Crypto from 'crypto'; Leveraging the AI node generator - https://docs.buildship.com/ai-nodes#example-prompt-to-generate-node-using-any-api.
MDN Web Docs
import - JavaScript | MDN
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are called live bindings because they are updated by the module that exported the binding, but cannot be re-assigned by the importing module.
AI Generated Nodes – BuildShip
A unified resource to start building your backend with low-code. Dive into triggers, nodes, and step-by-step guidance to jumpstart your workflow creation.
Sleetza
Sleetza7mo ago
Mmm I might have an other issue then and it might have to do with the package itself. Thanks
Sleetza
Sleetza7mo ago
@Gaurav Chadha I am getting these kind of errors everytime I am trying to incorporate a package. Any idea what might be causing them?
No description
Sleetza
Sleetza7mo ago
This is my import statement: import { getDocument } from 'pdfjs-dist/es5/build/pdf';
Gaurav Chadha
Gaurav Chadha7mo ago
The package should provide a headless method, you can check on their documentation. The import should be like this import PDFDocument from 'pdfjs'; I would recommend to use BuildShip's AI generator.