UNPKG

512 BPlain TextView Raw
1import jsonLdScript from './snippet/json-ld-script';
2import { resolve as resolvePath } from 'path';
3import createFile from 'vamtiger-create-file';
4
5const { cwd } = process;
6const folder = resolvePath(
7 cwd(),
8 'source'
9);
10
11export default async function({ packagePath }: IParams) {
12 const { name } = require(packagePath);
13 const filePath = resolvePath(
14 folder,
15 `${name}.ts`
16 );
17
18 await createFile(filePath, jsonLdScript);
19}
20
21export interface IParams {
22 packagePath: string;
23}