{"id":19009112,"url":"https://github.com/gamtiq/makef","last_synced_at":"2026-05-17T02:10:41.667Z","repository":{"id":55942939,"uuid":"266607690","full_name":"gamtiq/makef","owner":"gamtiq","description":"Utilities to create files inside specified directory or copy files","archived":false,"fork":false,"pushed_at":"2021-06-17T19:57:19.000Z","size":166,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T05:42:09.148Z","etag":null,"topics":["content","copy","create","directory","empty","file","files","json","make","nojekyll","output","produce","subdirectory","utility","write"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gamtiq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-24T19:10:41.000Z","updated_at":"2023-02-07T14:07:37.000Z","dependencies_parsed_at":"2022-08-15T10:00:43.690Z","dependency_job_id":null,"html_url":"https://github.com/gamtiq/makef","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gamtiq/makef","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamtiq%2Fmakef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamtiq%2Fmakef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamtiq%2Fmakef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamtiq%2Fmakef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gamtiq","download_url":"https://codeload.github.com/gamtiq/makef/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamtiq%2Fmakef/sbom","scorecard":{"id":418042,"data":{"date":"2025-08-11","repo":{"name":"github.com/gamtiq/makef","commit":"ae4ab0405266c86944e08814ff25c4153facd076"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"17 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T00:25:53.199Z","repository_id":55942939,"created_at":"2025-08-19T00:25:53.199Z","updated_at":"2025-08-19T00:25:53.199Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33125184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"online","status_checked_at":"2026-05-17T02:00:05.366Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["content","copy","create","directory","empty","file","files","json","make","nojekyll","output","produce","subdirectory","utility","write"],"created_at":"2024-11-08T19:06:37.640Z","updated_at":"2026-05-17T02:10:41.640Z","avatar_url":"https://github.com/gamtiq.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# makef \u003ca name=\"start\"\u003e\u003c/a\u003e\n\nUtilities to create files inside specified directory or copy files.\n\nFeatures:\n* Create synchronously one file or several files at once.\n* Any content for a file is automatically converted to string. `JSON.stringify` is used to convert objects or arrays.\n* It is possible to skip creating of some files by specifying `false`, `null` or `undefined` as content value.\n* Determine whether a file should be created and/or form a file content dynamically by using a function as value for the file.\n* Specify any correct path as a file name. The path will be resolved regarding current working directory. Any subdirectory will be automatically created.\n* Create a copy of another file by using `copyFile`.\n\n```js\n// Create several files in current working directory\nmakef.createFile({\n    // The following file will be created with empty content\n    'a.txt': '',\n    // The following file will be created in subdirectory b\n    'b/c.log': 'some data',\n    // The following file will not be created\n    'd.file': false,\n    // The object that is specified as content will be converted to JSON\n    'file.json': {some: 'data'},\n    // The following file will be copied\n    'copy.data': makef.copyFile('../some/dir/source.file')\n});\n```\n\n[See more examples below.](#examples)\n\n## Table of contents\n\n* [Usage](#usage)\n* [Examples](#examples)\n* [API](#api)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Usage \u003ca name=\"usage\"\u003e\u003c/a\u003e [\u0026#x2191;](#start)\n\nInstallation:\n\n    npm install makef\n\nNext in a module:\n\n```js\nconst makef = require('makef');\nconst { createFile, copyFile } = makef;\n```\n\n## Examples \u003ca name=\"examples\"\u003e\u003c/a\u003e [\u0026#x2191;](#start)\n\nCreate one empty file:\n```js\ncreateFile('.nojekyll');\n```\nor\n```js\ncreateFile({'.nojekyll': ''});\n```\nor\n```js\ncreateFile({'.nojekyll': true});\n```\n\nCreate several files at once:\n```js\ncreateFile({\n    '.nojekyll': true,\n    'LICENSE': 'Some license data here',\n    'very/important/file.txt': 'very important data',\n    'config.json': {\n        a: 2,\n        topics: ['home', 'docs'],\n        url: 'http://some.server.net'\n    },\n    'subdir/another.log': makef.copyFile('./path/to/logs/data.log')\n});\n```\n\nSkip creating some files by setting `false`/`null` value for them:\n```js\ncreateFile({\n    '.nojekyll': false,\n    'a.txt': 'content',\n    'some/dir/file.md': null\n});\n```\n\nSpecify directory where files should be created:\n```js\ncreateFile(\n    {\n        '.nojekyll': '',\n        'data.json': {\n            a: 1,\n            b: {\n                c: 3\n            }\n        },\n        'subdir/file.data': 123\n    },\n    {\n        dir: '/path/to/some/dir'\n    }\n);\n```\n\nForm content for a file dynamically or skip creation by using a function:\n```js\nconst path = require('path');\n\nfunction getContent(file, env) {\n    return env.data.filter(env.filePath)\n        ? env.data.getData(file)\n        : null;\n}\n\ncreateFile(\n    {\n        'a.txt': getContent,\n        'b.log': 'static data',\n        'c.data': getContent,\n        'some/dir/file.txt': getContent\n    },\n    {\n        data: {\n            filter: (file) =\u003e path.extname(file) === '.txt',\n            getData: (file) =\u003e `content of ${file}`\n        }\n    }\n);\n```\n\nCopy a file:\n```js\nmakef.copyFile(\n    'source.txt',\n    'data.txt',\n    {\n        sourceDir: './from/some/dir',\n        dir: '../target/data/dir'\n    }\n);\n```\n\nSee additional examples in tests.\n\n## API \u003ca name=\"api\"\u003e\u003c/a\u003e [\u0026#x2191;](#start)\n\n### `createFile(fileSet, settings?): object`\n\nCreate specified files.\n\nArguments:\n\n* `fileSet: object | string` - Name of empty file or set of files that should be created.\n    \n    If a string is passed it is treated as name of the only empty file that should be created.\n    When an object is passed its fields are used as file names and field values determine contents\n    for corresponding files.\n\n    When a function is specified as field value it will be called to get content for the file.\n    The following parameters are passed into a function:\n    - `fileName: string` - name of file that should be created as specified in a field name of `fileSet`.\n    - `env: object` - additional contextual data.\n    - `env.data: any` - value of `settings.data` (see below).\n    - `env.dir: string` - directory where file should be created; it is value of `settings.dir` (see below)\n        or empty string.\n    - `env.dirPath: string` - absolute path to directory where file should be created.\n    - `env.filePath: string` - absolute path to file that should be created.\n    - `env.logger: object` - An object having methods `log` (or `info`) and `error` that can be used for logging.\n        See `settings.logger` below for details.\n\n    A value returned from the function will be processed to form file content.\n\n    Content values (specified as a field value or returned from a function) are treated in the following way:\n    - `false`, `null` or `undefined` - means that the corresponding file should not be created.\n    - `true` - means that the corresponding file should be created with empty content.\n    - an object or an array - is converted to JSON that is used as file content.\n    - any other value - is converted to string that is used as file content.\n* `settings?: object` - Operation settings.\n* `settings.context?: object` - Object that should be used as `this` when calling a function to get a file content.\n* `settings.data?: any` - Any data that should be passed to a function that is used to get a file content.\n* `settings.dir?: string` - Directory that will be used to resolve (form) absolute path for relative file names.\n    I.e. it is base/target directory for created files.\n    By default the current working directory is used.\n* `settings.logger?: object` - An object having methods `log` (or `info`) and `error` that should be used for logging.\n    Pass `false` to disable logging.\n    Skipping this option or passing any other falsy value (i.e. `null`, `undefined`, `0`, etc)\n    or `true` will cause to use `console` as logger.\n\nReturns object representing creation result, or `undefined` when `fileSet` is not specified and no file is processed.\nObject fields are file names as specified in `fileSet`,\na field value is absolute path of the corresponding file,\nor error object when the file is not created by some reason.\n\n### `copyFile(sourceFile, destFile?, settings?): Function | void`\n\nCopy specified file.\n\nArguments:\n\n* `sourceFile: string` - Name/path of file that should be copied.\n* `destFile?: string` - Name/path of destination file that should be created.\n    If the file is not set a partially applied function will be returned\n    that can be used to copy source file several times by passing a destination file and settings as arguments.\n* `settings?: object` - Operation settings.\n* `settings.dir?: string` - Directory where destination file should be created.\n    By default the current working directory is used.\n* `settings.logger?: object` - An object having methods `log` (or `info`) and `error` that should be used for logging.\n    See the corresponding setting of `createFile` for details.\n* `settings.sourceDir?: string` - Directory where source file is located.\n\nReturns a partially applied function when `destFile` is not specified.\n\n## Contributing \u003ca name=\"contributing\"\u003e\u003c/a\u003e [\u0026#x2191;](#start)\nIn lieu of a formal style guide, take care to maintain the existing coding style.\nAdd unit tests for any new or changed functionality.\nLint and test your code.\n\n## License \u003ca name=\"license\"\u003e\u003c/a\u003e [\u0026#x2191;](#start)\nCopyright (c) 2020 Denis Sikuler  \nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamtiq%2Fmakef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamtiq%2Fmakef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamtiq%2Fmakef/lists"}