What is @jupyterlab/coreutils?
@jupyterlab/coreutils is a utility library for JupyterLab that provides a set of core utilities for working with JupyterLab extensions and applications. It includes functions for handling settings, time, URLs, and more.
What are @jupyterlab/coreutils's main functionalities?
Settings
This feature allows you to manage settings for JupyterLab extensions. The code sample demonstrates how to load settings for a specific plugin.
const { Settings } = require('@jupyterlab/coreutils');
const settings = new Settings({
serverSettings: { baseUrl: 'http://localhost:8888' },
pluginId: 'my-plugin'
});
settings.load().then(data => {
console.log(data);
});
Time
This feature provides utilities for handling and formatting time. The code sample shows how to format the current date and time.
const { Time } = require('@jupyterlab/coreutils');
const timestamp = Time.format(new Date(), 'YYYY-MM-DD HH:mm:ss');
console.log(timestamp);
URLs
This feature includes utilities for working with URLs. The code sample demonstrates how to join parts of a URL into a full URL.
const { URLExt } = require('@jupyterlab/coreutils');
const fullUrl = URLExt.join('http://localhost:8888', 'api', 'contents');
console.log(fullUrl);
Other packages similar to @jupyterlab/coreutils
lodash
Lodash is a modern JavaScript utility library delivering modularity, performance, and extras. It provides a wide range of utility functions for common programming tasks, similar to the core utilities provided by @jupyterlab/coreutils, but it is more general-purpose and not specific to JupyterLab.
moment
Moment.js is a library for parsing, validating, manipulating, and formatting dates. It offers similar time-related functionalities as the Time module in @jupyterlab/coreutils but is more comprehensive and widely used for date and time manipulation.
axios
Axios is a promise-based HTTP client for the browser and Node.js. It provides functionalities for making HTTP requests, similar to the server settings and URL handling features in @jupyterlab/coreutils, but is more focused on HTTP communication.
@jupyterlab/coreutils
A JupyterLab package which provides utility functions that are widely used
across many of the @jupyterlab
packages. This includes (among other things)
functions for manipulating paths, urls, and the notebook format.
This package is intended for use within both Node.js and browser environments.