@iobroker/create-adapter
Version:
Command line utility to create customized ioBroker adapters
30 lines (29 loc) • 1.05 kB
TypeScript
/**
*
* @param packageName
*/
export declare function hasVersionSpecifier(packageName: string): boolean;
/**
*
* @param packageNameAndVersion
*/
export declare function getVersionSpecifier(packageNameAndVersion: string): string | undefined;
/**
* Returns only the package name from a string of the form [@scope/]package-name@version
*
* @param packageNameAndVersion
*/
export declare function getPackageName(packageNameAndVersion: string): string;
/**
* Returns the latest version of an npm package
*
* @param packageName The npm package name
* @param fallbackVersion The fallback version to return in case anything goes wrong. If this is set, no error is thrown.
*/
export declare function fetchPackageVersion(packageName: string, fallbackVersion?: string): Promise<string>;
/**
* Returns the reference to the version of an npm package
*
* @param packageName The npm package name (may include a version specifier like `abc@1.2.3`)
*/
export declare function fetchPackageReferenceVersion(packageName: string): Promise<string>;