@jondotsoy/demo-workspace
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

demo-workspace

Make a workspace to write files easily ideal to write your tests

How to use

Install with npm

npm add @jondotsoy/demo-workspace

In your code:

import { demoWorkspace } from "@jondotsoy/demo-workspace";

const workspace = demoWorkspace();

const file = workspace.file(
  "sample.ts",
  `
    console.log("OK");
  `
);

console.log(file);
// =>
// {
//   location: new URL('file:./__demos__/index/sample.ts')
// }

Also, your can be use Workspace.property.makeTree() for multiple files.

const file = workspace.makeTree({
  "README.md": `
    # Sample
  `,
  "src/index.ts": `
    console.log('Ok')
  `,
  "src/configs.json": JSON.stringify({
    foo: "baz",
  }),
});
// =>
// {
//   'README.md': new URL('file:./__demos__/index/README.md'),
//   'src/index.ts': new URL('file:./__demos__/index/src/index.ts'),
//   'src/configs.json': new URL('file:./__demos__/index/src/configs.json')
// }

Readme

Keywords

Package Sidebar

Install

npm i @jondotsoy/demo-workspace

Weekly Downloads

0

Version

1.1.3

License

MIT

Unpacked Size

35.4 kB

Total Files

10

Last publish

Collaborators

  • jondotsoy