@naturalcycles/nodejs-lib
Version:
Standard library for Node.js
48 lines (47 loc) • 922 B
TypeScript
export interface Json2EnvOptions {
jsonPath: string;
prefix?: string;
/**
* @default true
*/
saveEnvFile?: boolean;
/**
* @default true
*/
bashEnv?: boolean;
/**
* @default true
*/
githubEnv?: boolean;
/**
* @default true
*/
fail?: boolean;
debug?: boolean;
silent?: boolean;
}
export declare function json2env(opt: Json2EnvOptions): void;
/**
* Turns Object with keys/values into a *.sh script that exports all keys as values.
*
* @example
* { a: 'b', b: 'c'}
*
* will turn into:
*
* export a="b"
* export b="c"
*/
export declare function objectToShellExport(o: any, prefix?: string): string;
/**
* Turns Object with keys/values into a file of key-value pairs
*
* @example
* { a: 'b', b: 'c'}
*
* will turn into:
*
* a=b
* b=c
*/
export declare function objectToGithubActionsEnv(o: any, prefix?: string): string;