Home > @microsoft/node-core-library

node-core-library package

Core libraries that every NodeJS toolchain project should use.


Class Description
Colors (BETA) The static functions on this class are used to produce colored text for use with the node-core-library terminal.
ConsoleTerminalProvider (BETA) Terminal provider that prints to STDOUT (for log- and verbose-level messages) and STDERR (for warning- and error-level messsages).
Executable The Executable class provides a safe, portable, recommended solution for tools that need to launch child processes.
FileSystem The FileSystem API provides a complete set of recommended operations for interacting with the file system.
FileWriter API for interacting with file handles.
InternalError An Error subclass that should be thrown to report an unexpected state that may indicate a software defect. An application may handle this error by instructing the end user to report an issue to the application maintainers.
JsonFile Utilities for reading/writing JSON files.
JsonSchema Represents a JSON schema that can be used to validate JSON data files loaded by the JsonFile class.
LegacyAdapters Helper functions used when interacting with APIs that do not follow modern coding practices.
LockFile A helper utility for working with file-based locks. This class should only be used for locking resources across processes, but should not be used for attempting to lock a resource in the same process.
MapExtensions Helper functions for working with the Map<K, V> data type.
PackageJsonLookup This class provides methods for finding the nearest “package.json” for a folder and retrieving the name of the package. The results are cached.
PackageName Various functions for working with package names that may include scopes.
Path Common operations for manipulating file and directory paths.
ProtectableMap The ProtectableMap provides an easy way for an API to expose a Map<K, V> property while intercepting and validating any write operations that are performed by consumers of the API.
Sort Operations for sorting collections.
StringBufferTerminalProvider (BETA) Terminal provider that stores written data in buffers separated by severity. This terminal provider is designed to be used when code that prints to a terminal is being unit tested.
StringBuilder This class allows a large text string to be constructed incrementally by appending small chunks. The final string can be obtained by calling StringBuilder.toString().
Terminal (BETA) This class facilitates writing to a console.
Text Operations for working with strings that contain text.


Enumeration Description
ColorValue (BETA) Colors used with IColorableSequence.
Encoding The allowed types of encodings, as supported by Node.js
FileConstants String constants for common filenames and parts of filenames.
FolderConstants String constants for common folder names.
NewlineKind Enumeration controlling conversion of newline characters.
PosixModeBits An integer value used to specify file permissions for POSIX-like operating systems.
TerminalProviderSeverity (BETA)
TextAttribute (BETA) Text styles used with IColorableSequence.


Interface Description
IColorableSequence (BETA)
IConsoleTerminalProviderOptions (BETA) Options to be provided to a ConsoleTerminalProvider
IExecutableResolveOptions Options for Executable.tryResolve().
IExecutableSpawnSyncOptions Options for Executable.execute().
IFileSystemCopyFileOptions The options for FileSystem.copyFile()
IFileSystemCreateLinkOptions The options for FileSystem.createSymbolicLinkJunction(), createSymbolicLinkFile(), createSymbolicLinkFolder(), and createHardLink().
IFileSystemDeleteFileOptions The options for FileSystem.deleteFile()
IFileSystemMoveOptions The options for FileSystem.move()
IFileSystemReadFileOptions The options for FileSystem.readFile()
IFileSystemReadFolderOptions The options for FileSystem.readFolder()
IFileSystemUpdateTimeParameters The parameters for updateTimes(). Both times must be specified.
IFileSystemWriteFileOptions The options for FileSystem.writeFile()
IFileWriterFlags Interface which represents the flags about which mode the file should be opened in.
IJsonFileSaveOptions Options for JsonFile.saveJsonFile()
IJsonFileStringifyOptions Options for JsonFile.stringify()
IJsonSchemaErrorInfo Callback function arguments for JsonSchema.validateObjectWithCallback();
IJsonSchemaFromFileOptions Options for JsonSchema.fromFile()
IJsonSchemaValidateOptions Options for JsonSchema.validateObject()
INodePackageJson An interface for accessing common fields from a package.json file whose version field may be missing.
IPackageJson An interface for accessing common fields from a package.json file.
IPackageJsonDependencyTable This interface is part of the IPackageJson file format. It is used for the “dependencies”, “optionalDependencies”, and “devDependencies” fields.
IPackageJsonLookupParameters Constructor parameters for PackageJsonLookup
IPackageJsonScriptTable This interface is part of the IPackageJson file format. It is used for the “scripts” field.
IParsedPackageName A package name that has been separated into its scope and unscoped name.
IParsedPackageNameOrError Result object returned by PackageName.tryParse()
IProtectableMapParameters Constructor parameters for ProtectableMap
IStringBuilder An interface for a builder object that allows a large text string to be constructed incrementally by appending small chunks.
ITerminalProvider (BETA) Implement the interface to create a terminal provider. Terminal providers can be registered to a Terminal instance to receive messages.

Type Aliases

Type Alias Description
ExecutableStdioMapping Typings for IExecutableSpawnSyncOptions.stdio.
ExecutableStdioStreamMapping Typings for one of the streams inside IExecutableSpawnSyncOptions.stdio.
LegacyCallback Callback used by LegacyAdapters.