import * as hex from "https://deno.land/x/hex@0.6.5/src/lib/stdx/mod.ts";
Namespaces
Utilities for dealing with | |
Load environment variables from | |
Generators and validators for UUIDs for versions v1, v4 and v5. | |
Command line arguments parser based on minimist. | |
N fmt | |
Pretty print bytes. | |
String formatters and utilities for dealing with ANSI color codes. | |
Format milliseconds to time duration. | |
| |
N fs | Helpers for working with the filesystem. |
N log | Logging library with the support for terminal and file outputs. Also provides interfaces for building custom loggers. |
N path | Utilities for working with OS-specific file paths. |
The semantic version parser. | |
Utilities for working with the Streams API. | |
A library of assertion functions.
If the assertion is false an | |
A BDD interface
to | |
A mocking and spying library. | |
A snapshotting library. | |
Utilities for mocking time while testing. | |
N uuid | Generators and validators for UUIDs for versions v1, v4 and v5. |
Classes
An object that encapsulates provided message and arguments as well some metadata that can be later used when formatting a message. | |
A variable-sized buffer of bytes with | |
An error related to spying on a function or instance method. | |
Overrides the real Date object and timer functions with fake ones that can be controlled through the fake time instance. | |
An error related to faking time. |
Enums
Platform-specific conventions for the line ending format (i.e., the "end-of-line"). | |
Get log level numeric values through enum constants. Defaults to INFO. |
Variables
The number of milliseconds in a day. | |
The number of milliseconds in an hour. | |
The number of milliseconds in a minute. | |
The number of milliseconds in a second. | |
The number of milliseconds in a week. | |
Handlers are responsible for actual output of log messages. When a handler is
called by a logger, it firstly checks that | |
Functions
Returns the number of the day in the year. | |
Returns the difference of the 2 given dates in the given units. If the units are omitted, it returns the difference in the all available units. | |
Takes an input | |
Returns whether the given date or year (in number) is a leap year or not. based on: https://docs.microsoft.com/en-us/office/troubleshoot/excel/determine-a-leap-year | |
Takes an input | |
Formats the given date to IMF date time format. (Reference: https://tools.ietf.org/html/rfc7231#section-7.1.1.1). IMF is the time format to use when generating times in HTTP headers. The time being formatted must be in UTC for Format to generate the correct format. | |
Returns the ISO week number of the provided date (1-53). | |
Check if the passed UUID is the nil UUID. | |
Generates a RFC4122 v1 UUID (time-based). | |
Validates the UUID v1. | |
Validate that the passed UUID is an RFC4122 v4 UUID. | |
Generate a RFC4122 v5 UUID (SHA-1 namespace). | |
Validate that the passed UUID is an RFC4122 v5 UUID. | |
Test a string to see if it is a valid UUID. | |
Detect RFC version of a UUID. | |
Take a set of command line arguments, optionally with a set of options, and return an object representing the flags found in the passed arguments. | |
Convert bytes to a human-readable string: 1337 → 1.34 kB | |
Set background color to black. | |
Set background color to blue. | |
Set background color to bright black. | |
Set background color to bright blue. | |
Set background color to bright cyan. | |
Set background color to bright green. | |
Set background color to bright magenta. | |
Set background color to bright red. | |
Set background color to bright white. | |
Set background color to bright yellow. | |
Set background color to cyan. | |
Set background color to green. | |
Set background color to magenta. | |
Set background color to red. | |
Set background color using 24bit rgb.
| |
Set background color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit | |
Set background color to white. | |
Set background color to yellow. | |
Set text color to black. | |
Set text color to blue. | |
Make the text bold. | |
Set text color to bright black. | |
Set text color to bright blue. | |
Set text color to bright cyan. | |
Set text color to bright green. | |
Set text color to bright magenta. | |
Set text color to bright red. | |
Set text color to bright white. | |
Set text color to bright yellow. | |
Set text color to cyan. | |
The text emits only a small amount of light. | |
Get whether text color change is enabled or disabled. | |
Set text color to gray. | |
Set text color to green. | |
Make the text hidden. | |
Invert background color and text color. | |
Make the text italic. | |
Set text color to magenta. | |
Set text color to red. | |
Reset the text modified | |
Set text color using 24bit rgb.
| |
Set text color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit | |
Set changing text color to enabled or disabled | |
Put horizontal line through the center of the text. | |
Remove ANSI escape codes from the string. | |
Make the text underline. | |
Set text color to white. | |
Set text color to yellow. | |
Converts and format a variable number of | |
Converts and format a variable number of | |
Copy a file or directory. The directory can have contents. Like | |
Copy a file or directory. The directory can have contents. Like | |
Detect the EOL character for string input. returns null if no newline. | |
Ensures that a directory is empty.
Deletes directory contents if the directory is not empty.
If the directory does not exist, it is created.
The directory itself is not deleted.
Requires the | |
Ensures that a directory is empty.
Deletes directory contents if the directory is not empty.
If the directory does not exist, it is created.
The directory itself is not deleted.
Requires the | |
Ensures that the directory exists.
If the directory structure does not exist, it is created. Like mkdir -p.
Requires the | |
Ensures that the directory exists.
If the directory structure does not exist, it is created. Like mkdir -p.
Requires the | |
Ensures that the file exists.
If the file that is requested to be created is in directories that do not
exist.
these directories are created. If the file already exists,
it is NOTMODIFIED.
Requires the | |
Ensures that the file exists.
If the file that is requested to be created is in directories that do not
exist,
these directories are created. If the file already exists,
it is NOT MODIFIED.
Requires the | |
Ensures that the hard link exists. If the directory structure does not exist, it is created. | |
Ensures that the hard link exists. If the directory structure does not exist, it is created. | |
Ensures that the link exists. If the directory structure does not exist, it is created. | |
Ensures that the link exists. If the directory structure does not exist, it is created. | |
Test whether or not the given path exists by checking with the file system. | |
Test whether or not the given path exists by checking with the file system. | |
Expand the glob string from the specified | |
Synchronous version of | |
Format the file to the targeted EOL. | |
Moves a file or directory. | |
Moves a file or directory synchronously. | |
Walks the file tree rooted at root, yielding each file or directory in the tree filtered according to the given options. | |
Same as walk() but uses synchronous ops | |
Log with critical level, using default logger. | |
Log with debug level, using default logger. | |
Log with error level, using default logger. | |
Get a logger instance. If not specified | |
Log with info level, using default logger. | |
Setup logger config. | |
Log with warning level, using default logger. | |
Determines the common path from a set of paths, using an optional separator, which defaults to the OS default separator. | |
Convert a glob string to a regular expression. | |
Test whether the given string is a glob | |
Like join(), but doesn't collapse "**/.." when | |
Like normalize(), but doesn't collapse "**/.." when | |
Pass in a comparison string, and it'll call the corresponding comparison
function. | |
Returns | |
The same as | |
Returns difference between two versions by the release type ( | |
This is true if they're logically equivalent, even if they're not the exact same string. | |
Greater than comparison | |
Greater than or equal comparison | |
Returns true if version is greater than all the versions possible in the range. | |
Returns the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. | |
Returns true if the two supplied ranges or comparators intersect. | |
Less than comparison | |
Less than or equal comparison | |
Returns true if version is less than all the versions possible in the range. | |
Returns the major version number. | |
Returns the highest version in the list that satisfies the range, or | |
Returns the minor version number. | |
Returns the lowest version in the list that satisfies the range, or | |
Returns the lowest version that can possibly match the given range. | |
This is true if they're not logically equivalent, even if they're the exact same string. | |
Returns true if the version is outside the bounds of the range in either the
high or low direction. The hilo argument must be either the string '>' or
'<'. (This is the function called by | |
Attempt to parse a string as a semantic version, returning either a | |
Returns the patch version number. | |
Returns an array of prerelease components, or null if none exist. | |
Returns | |
Returns true if the version satisfies the range. | |
Returns the parsed version, or null if it's not valid. | |
Returns the valid range or null if it's not valid. | |
Make an assertion, error will be thrown if | |
Make an assertion that | |
Make an assertion that | |
Make an assertion that | |
Make an assertion that actual is not null or undefined. If not then throw. | |
Make an assertion that | |
Make an assertion that | |
Make an assertion that | |
Make an assertion that | |
Make an assertion that | |
Make an assertion that | |
Make an assertion that | |
Make an assertion that | |
Executes a function which returns a promise, expecting it to reject. | |
Make an assertion that | |
Make an assertion that actual includes expected. If not then throw. | |
Executes a function, expecting it to throw. If it does not, then it throws. | |
Deep equality comparison used in assertions | |
Forcefully throws a failed assertion | |
Use this to stub out methods that will throw when invoked. | |
Use this to assert unreachable code. | |
Run some shared teardown after all of the tests in the suite. | |
Run some shared teardown after each test in the suite. | |
Run some shared setup before all of the tests in the suite. | |
Run some shared setup before each test in the suite. | |
Registers a test suite. | |
Registers an individual test case. | |
Asserts that a spy is called as expected. | |
Asserts that a spy is called with a specific arg as expected. | |
Asserts that an spy is called with a specific range of args as expected. If a start and end index is not provided, the expected will be compared against all args. If a start is provided without an end index, the expected will be compared against all args from the start index to the end. The end index is not included in the range of args that are compared. | |
Asserts that an async spy is called as expected. | |
Asserts that a spy is called as much as expected and no more. | |
Creates a session that tracks all mocks created before it's restored. If a callback is provided, it restores all mocks created within it. | |
Creates an async session that tracks all mocks created before the promise resolves. | |
Creates a function that resolves the awaited iterable values. Any awaited iterable values that are errors will be thrown. | |
Restores all mocks registered in the current session that have not already been restored. If an id is provided, it will restore all mocks registered in the session associed with that id that have not already been restored. | |
Creates a function that returns one of its arguments. | |
Creates a function that returns its arguments or a subset of them. If end is specified, it will return arguments up to but not including the end. | |
Creates a function that returns the iterable values. Any iterable values that are errors will be thrown. | |
Creates a function that returns the instance the method was called on. | |
Wraps a function or instance method with a Spy. | |
Replaces an instance method with a Stub. | |
Make an assertion that | |
Default serializer for | |
Check if the passed UUID is the nil UUID. | |
Generates a RFC4122 v1 UUID (time-based). | |
Validates the UUID v1. | |
Validate that the passed UUID is an RFC4122 v4 UUID. | |
Generate a RFC4122 v5 UUID (SHA-1 namespace). | |
Validate that the passed UUID is an RFC4122 v5 UUID. | |
Test a string to see if it is a valid UUID. | |
Detect RFC version of a UUID. |
Interfaces
The options used for generating a v1 UUID. | |
The options for the | |
The options for pretty printing the byte numbers. | |
A parsed path object generated by path.parse() or consumed by path.format(). | |
Registers a test suite. | |
The options for creating a test suite with the describe function. | |
Registers an individual test case. | |
The options for creating an individual test case with the it function. | |
A group of tests. | |
Call information recorded by a spy. | |
A function or instance method wrapper that records all calls made to it. | |
Call information recorded by a spy. | |
An instance method replacement that records all calls made to it. | |
The options used for generating a v1 UUID. |
Type Aliases
The value returned from | |
Union of valid log level strings | |
The semantic version parser. | |
The arguments for a DescribeFunction. | |
The arguments for an ItFunction. | |