fs-extra#copyFile TypeScript Examples

The following examples show how to use fs-extra#copyFile. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: packaging-manager.ts    From nx-plugins with MIT License 6 votes vote down vote up
private async putAssetsNextToFunctionFiles(
    assets: string[],
    outputAbsolutePath: string,
  ): Promise<void> {
    if (!assets.length) {
      return;
    }
    await Promise.all(
      assets.map(async (file) => {
        const src = join(this.originalServicePath, file);
        const dst = join(outputAbsolutePath, file);
        await ensureDir(dirname(dst));
        return await copyFile(src, dst);
      }),
    );
  }
Example #2
Source File: ResourceWriter.ts    From joplin-blog with MIT License 5 votes vote down vote up
async copy(resourcePath: string) {
    await copyFile(
      path.resolve(resourcePath),
      path.resolve(this.config.resourcePath, path.basename(resourcePath)),
    )
  }