• Version 3.0.0
  • Published
  • 12.1 kB
  • 6 dependencies
  • MIT license


npm i fixturify
yarn add fixturify
pnpm add fixturify


Convert objects into directory structures and back again



function readSync

readSync: (dir: string, options?: Options, _relativeRoot?: string) => DirJSON;

    function writeSync

    writeSync: (dir: string, obj: DirJSON) => void;


      interface DirJSON

      interface DirJSON {}
      • A recursive JSON representation of a directory. This representation includes both files, their contents and directories which can contain both files and directories.

        ```ts const files : DirJSON = { 'index.js': 'content', 'foo.txt': 'content', 'folder': { 'index.js': 'content', 'apple.js': 'content', 'other-folder': { } }, } ```

      index signature

      [filename: string]: DirJSON | string | null;

        interface Options

        interface Options {}

          property directories

          directories?: boolean;

            property exclude

            exclude?: (IMinimatch | string)[];

              property globs

              globs?: (string | IMinimatch)[];

                property ignore

                ignore?: (string | IMinimatch)[];

                  property ignoreEmptyDirs

                  ignoreEmptyDirs?: boolean;

                    property include

                    include?: (IMinimatch | string)[];

                      Package Files (1)

                      Dependencies (6)

                      Dev Dependencies (4)

                      Peer Dependencies (0)

                      No peer dependencies.


                      To add a badge like this badgeto your package's README, use the codes available below.

                      You may also use to create a custom badge linking to

                      • Markdown
                      • HTML
                        <a href=""><img src="" alt=""></a>