Skip to content

dmail-old/project-structure

Repository files navigation

project-structure

npm package build codecov

Associate data to pathname using pattern.

Example

import { pathnameToMeta } from "@dmail/project-structure"

const metaDescription = {
  "/*.js": {
    extension: "js",
  },
  "/*.json": {
    extension: "json",
  },
  "/file.js": {
    foo: true,
  },
}

pathnameToMeta({ pathname: "/file.js", metaDescription }) // { extension: "js", foo: true }
pathnameToMeta({ pathname: "/file.json", metaDescription }) // { extension: "json" }

Interactive example

You can test if a pathname matches a pattern at the following url: https://dmail.github.io/project-structure/interactive-example/interactive-example.html

About

Pattern matching to describe a project file structure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published