0.1.3 • Published 4 years ago
@expo/envsub v0.1.3
@expo/envsub
@expo/envsub
provides file-level variable substitution (Mustache template style).
API
envsub(templateFile: string, outputFile: string, envs: Record<string, string | number>): Promise<void>
Usage example
import envsub from '@expo/envsub';
await envsub('abc.json.template', 'abc.json', { ABC: 123, XYZ: 789 });
abc.json.template
file contents:
{
"someKey": {{ ABC }},
"anotherKey": {{ XYZ }}
}
abc.json
file should be created with the following contents:
{
"someKey": 123,
"anotherKey": 789
}