Skip to main content

Nexus Node SDK

This package contains a collection of modules that provide a common functionality for the Node.js runtime. Generally, the modules in this package are not intended to be used directly, but rather are used internally within other Nexus packages.

Certificates

FunctionDescription
readCertFilesAttempts to read local development cert files if they are available.

Environment

VariableDescription
developmentEnvironmentConstant determining whether the current environment is not production.
productionEnvironmentConstant determining whether the current environment is production.

Files

FunctionDescription
checkIfExistsCheck if a file exists at the given path.
extractZipExtract the contents of a zip file.
readLocalJSONFileRead a local JSON file from the repository.
readLocalTextFileRead a local text file from the repository.
writeLocalBufferWrite a local text file to the repository.
writeLocalJSONFileWrite a local JSON file to the repository.
writeLocalTextFileWrite a local text file to the repository.

Node

FunctionDescription
checkIfExistsCheck if a file exists at the given path.
readLocalJSONFileRead a local JSON file from the repository.
readLocalTextFileRead a local text file from the repository.
writeLocalBufferWrite a local text file to the repository.
writeLocalJSONFileWrite a local JSON file to the repository.
writeLocalTextFileWrite a local text file to the repository.

Other

Enumeration, Class, Interface, Type alias, Variable, FunctionDescription
BarCharacterA character to use for the progress bar.
DataSourceFileValid data source files.
DataSourceNameValid data source package names.
LineDelimitedCharacterCommonly used character codes for newline-delimited files.
SQLiteFileExtension-
NexusDataSourceA TypeORM data source for ISP Nexus modules.
ParquetReaderA typed Parquet reader, wrapping the base Parquet reader.
ParquetSchemaTyped Parquet schema.
ParquetSchemaDefinitionCache-
ParquetWriterA typed Parquet writer, wrapping the base Parquet writer.
SnakeNamingStrategyA TypeORM naming strategy that converts names to snake_case.
SpatiaLiteDriverA TypeORM driver for working with SpatiaLite databases.
SpatiaLiteQueryRunner-
BarPayloadPayload for a progress bar.
ChildProgressBarChild instance of a progress bar managed by a ProgressBarManager.
ColumnInfoInformation about a column in a table.
CreateCLIProgressBarOptions-
CreateNewlineWriterOptions-
MigrationMetadata-
NewlineWriter-
NexusDataSourceConfig-
ProgressBarManager-
ResolvedESModuleResolved ES module type with a default export.
SQLPathConfigResult of inferring SQL paths from a source file or directory.
TakeReadStreamLinesOptionsOptions for reading newline-delimited files.
BufferLikeA buffer-like object that can be written to a file.
CamelCaseKeyConvert literal string types like 'foo-bar' to 'fooBar', allowing all PropertyKey types.
CommandHandlerA command handler, as used by yargs.
EnvironmentModuleSourceSource from which to import the environment module.
ExtractESModuleDefaultType-helper to extracts the default export from an ES module.
MemoryDBStoragePath-
MigrationDirection-
MigrationInterfaceConstructor-
ParquetRecordLikeA Parquet record-like object, i.e. a record with string keys and JSON-serializable values.
ParquetSchemaDefinitionTyped Parquet schema definition.
ScriptCallbackA script callback function to invoke.
SQLFieldWithoutPostProcessing-
SQLitePragmaA pragma that can be set on a SQLite database.
SQLitePragmaRecordA record of SQLite pragmas and their respective values.
SQLitePragmaValueThe value of a pragma that can be set on a SQLite database.
StrictArgKeysThe keys of StrictArgs.
StrictArgsCommand handler arguments, with all keys available in camelCase.
TLSCertResultResult of reading local development cert files.
UnparsedRowA row of data that has not been fully parsed by TypeORM.
WriteMigrationOptions-
ZipEntryContentPair-
$prefersJSONLoggingWhether to prefer JSON logging.
$privateA record containing only private environment variables.
$ProgressBarManagerProgress bar manager for CLI task runners.
$publicA record containing only public environment variables.
DefaultSpatialiteExtensionFileNameDefault Spatialite extension file name.
MemoryDBStoragePathVirtual path for an in-memory SQLite database.
assertDirectoryIsUntrackedAsserts that the given directory is ephemeral, i.e. not a source code directory and capable of being cleaned.
assertExpectedFileExtensionRuntime assertion that a file extension is one of the expected values.
assertIsDirectoryAsserts that the given path is a directory.
changeFileExtension-
cleanCompiledArtifactsCleans the compiled TypeScript artifacts for the given package.
cleanDirectoryCleans the given directory, creating it if it does not exist.
cleanDistributionArtifacts-
cleanFileCleans the given file path.
cleanGeneratedArtifacts-
collectPendingMigrationFiles-
copyToClipboardCopy the given input to the OS clipboard.
createBloomFiltersGiven a Parquet schema and a list of columns, create a list of Bloom filters for those columns.
createCLIProgressBarCreate a new CLI progress bar.
createETag-
createNewlineWriterCreates a writer for newline-delimited files.
dataSourcePathBuilderPath builder relative to the package root.
extractSingleFileZipExtract the contents of a zip file and return the first entry.
importEnvironmentModule-
inferColumnIndexConfig-
inferIndexNameGiven a column name, infers a reasonable index name.
inferSQLPathsInfer common SQL paths from a single source.
logScriptErrorLogs an error that occurred while running a script.
matchOneCreates a where clause such as that each criteria only needs to be met once.
pluckDefaultExportPlucks the default export from an ES module.
pluckFileExtensionPluck the file extension from a file name.
postScriptCleanupCleans up services and exits the script cleanly.
prepareMigrationsTablePrepares the migrations table in the database.
readCurrentMigrations-
readRange-
runIfScriptGiven a module's import.meta object, resolves if the module was run as a NPM script.
runMigrationReads a migration file from disk.
runScriptRuns a script callback and handles cleanup.
takeBufferLinesGiven a buffer containing newline-delimited data, yield each line.
takeReadStreamLinesGiven a readable stream containing newline-delimited data, yield each line.

SQL

Interface, FunctionDescription
MigrationOptionsOptions for creating a migration.
createMigrationTemplateCreates a migration template.
findCachedSpatialiteExtensionPathCached variant of findSpatialiteExtensionPath.
findSpatialiteExtensionPath-
migrationIDToFileNameCreates a migration file name.
migrationPreambleCreates a preamble to document the migration.
parseMigrationFileNameParses a migration file name.
runSQLInShellRuns a SQL command in a child shell.
spatialiteInitTemplateEmits a template for initializing a SpatiaLite database.
writeMigrationFileWrites a migration file to disk.

Spatialite

FunctionDescription
findCachedSpatialiteExtensionPathCached variant of findSpatialiteExtensionPath.
findSpatialiteExtensionPath-

Utilities

FunctionDescription
readCertFilesAttempts to read local development cert files if they are available.