📚Third-party libraries
Early in their careers, every developer learns one of the most critical principles of software engineering: DRY (Don’t Repeat Yourself). Leveraging third-party libraries is a time-saving practice, sparing developers the need to develop functionalities already provided by the library. QuickDEV offers several built-in third-party libraries for common tasks, and you can manually import additional libraries as needed.
Built-in libraries
QuickDEV provides some JavaScript built-in libraries for use.
Built-in Libraries can be used directly everywhere where you can use JavaScript.
// uuid
return uuid.v1();
=> de9e2f70-fe58-11ee-b767-c918daf038d2
// loadash
return _.chunk(['1_a', '1_b', '2_a', '2_b'], 2);
=> [['1_a', '1_b'], ['2_a', '2_b']]
// numbro
return numbro(5600).format({thousandSeparated: true});
=> 5,600
// Papaparse
return Papa.parse("name|age\nMike|25\nBob|36", {delimiter: "|"})
// => {"data":[["name","age"],["Mike","25"],["Bob","36"]],"errors":[],"meta":{"delimiter":"|","linebreak":"\n","aborted":false,"truncated":false,"cursor":23}}
External libraries
It is possible to import external libraries at the workspace or app level.
Import at the application level
Go to the settings page and select the JavaScript library tab. Then, click the addition icon (+). After pasting the library URL, select Add New. At this point, QuickDEV will determine whether the external library is compatible and safe to use.
You can also click the download icon to quickly download any recommended JS library.
For this example i will use: https://unpkg.com/[email protected]/build/cowsay.umd.js

Now, you can create a JS query and insert code.

return window.cowsay.say({
text : "QuickDEV is cool", e : "oO", T : "U "
})
You cannot use the cowsay library in any other app in your workspace because it is imported at the app level in our example.

External libraries imported into QuickDEV are attached to the window instance.
Import at the workspace level
Navigate to QuickDEV homepage.
Choose Settings > Advanced > Add.
Copy the URL of the third-party JavaScript library you want to add.
Select "Add New" and paste the copied URL.
Once added, all apps within your workspace can access the installed libraries.

Last updated