{"id":19574346,"url":"https://github.com/straticjs/stratic-decorate-files","last_synced_at":"2026-05-13T18:40:08.688Z","repository":{"id":57371907,"uuid":"104700427","full_name":"straticjs/stratic-decorate-files","owner":"straticjs","description":"Decorate Stratic files with standard useful information","archived":false,"fork":false,"pushed_at":"2018-12-17T06:23:30.000Z","size":32,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-28T04:02:52.004Z","etag":null,"topics":["gulp","gulp-plugin","hacktoberfest","javascript","stratic"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/straticjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-25T03:42:40.000Z","updated_at":"2021-10-07T17:00:36.000Z","dependencies_parsed_at":"2022-09-07T18:10:25.374Z","dependency_job_id":null,"html_url":"https://github.com/straticjs/stratic-decorate-files","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/straticjs/stratic-decorate-files","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-decorate-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-decorate-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-decorate-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-decorate-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/straticjs","download_url":"https://codeload.github.com/straticjs/stratic-decorate-files/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-decorate-files/sbom","scorecard":{"id":854731,"data":{"date":"2025-08-11","repo":{"name":"github.com/straticjs/stratic-decorate-files","commit":"3ad950eb138d9f4dc32217a450770a328c421936"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"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":"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":"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/12 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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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: COPYING:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: COPYING: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"}}]},"last_synced_at":"2025-08-23T23:34:39.363Z","repository_id":57371907,"created_at":"2025-08-23T23:34:39.363Z","updated_at":"2025-08-23T23:34:39.363Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285299190,"owners_count":27148079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-19T02:00:05.673Z","response_time":65,"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":["gulp","gulp-plugin","hacktoberfest","javascript","stratic"],"created_at":"2024-11-11T06:40:12.007Z","updated_at":"2025-11-19T18:04:01.031Z","avatar_url":"https://github.com/straticjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `stratic-decorate-files`\n\n[Gulp][1] plugin to decorate Stratic files with standard useful information\n\n## Installation\n\n    npm install stratic-decorate-files\n\n## Usage\n\nTo use this module, just pipe a stream of parsed Stratic posts into it. It's probably a bad idea to do this after you've added extra files into the stream, like e.g. templates.\n\n**Note:** it's actually very important to use the values produced by this module. It's very easy to do, for example:\n\n```js\nvar date = new Date(post.data.time.epoch * 1000);\nvar month = date.getMonth();\n// Etc.\n```\n\nbut this is _wrong_ because it doesn't take the UTC offset into account. If you rebuild your site in a different timezone, you may find that some posts - particularly those authored near the boundaries between days, months, or years - will now display a different timestamp.\n\nThis module will take care of handling the offset for you, so you don't have to worry about any of that. Plus, some of the values it provides (particularly `monthName`) are awkward to get with regular `Date` objects, so now you don't have to worry about that either.\n\nSee \"Properties\" below for the full list of properties this module provides.\n\n## Example\n\nMinimal example:\n\n```js\nvar gulp = require('gulp');\nvar frontMatter = require('gulp-gray-matter');\nvar straticDecorateFiles = require('stratic-decorate-files');\n\ngulp.task('post-index', function() {\n\treturn gulp.src('*.md')\n\t           .pipe(frontMatter())\n\t           .pipe(straticDecorateFiles());\n});\n```\n\nFull example:\n\n```js\nvar gulp = require('gulp');\nvar remark = require('gulp-remark');\nvar remarkHtml = require('remark-html');\nvar frontMatter = require('gulp-gray-matter');\nvar straticDecorateFiles = require('stratic-decorate-files');\nvar straticPostsToIndex = require('stratic-posts-to-index');\nvar addsrc = require('gulp-add-src');\nvar jade = require('gulp-jade');\nvar straticDateInPath = require('stratic-date-in-path');\nvar rename = require('gulp-rename');\n\ngulp.task('post-index', function() {\n\treturn gulp.src('*.md')\n\t           .pipe(frontMatter())\n\t           .pipe(remark().use(remarkHtml))\n\t           .pipe(straticDateInPath())\n\t           .pipe(straticDecorateFiles())\n\t           .pipe(addsrc('index.jade'))\n\t           .pipe(straticPostsToIndex('index.jade'))\n\t           .pipe(jade({basedir: __dirname}))\n\t           .pipe(rename({ extname: '.html' }))\n\t           .pipe(gulp.dest('dist'));\n});\n```\n\n## Properties\n\nEach of these properties is attached to `file.data.time`; e.g. `file.data.time.year` for `year`. If `file.data.edited` is present, it also gets these properties attached.\n\n`moment` (`Object`) - a [MomentJS][] moment, preconfigured to handle the offset. Use this if what you need isn't already exposed.\n\n`year` (`Number`) - the year the post was authored, as you would get from `Date#getFullYear()`\n\n`yearStr` (`String`) - the year the post was authored, typecast to a string\n\n`month` (`Number`) - the month the post was authored, as you would get from `Date#getMonth()` (i.e. zero-indexed)\n\n`monthName` (`String`) - the name of the month the post was authored in; e.g. `January`\n\n`monthStr` (`String`) - the month the post was authored in, made human-readable (i.e. `1` for January) and typecast to a string\n\n`monthUrlStr` (`String`) - `monthStr` but with a `0` prepended if necessary to make the month two characters\n\n`dayOfMonth` (`Number`) - the day of the month the post was authored, as you would get from `Date#getDate()`\n\n`dayOfMonthStr` (`String`) - the day of the month the post was authored, typecast to a string\n\n## Code of Conduct\n\nPlease note that StraticJS is developed under the [Contributor Covenant][3] Code of Conduct. Project contributors are expected to respect these terms.\n\nFor the full Code of Conduct, see [CODE_OF_CONDUCT.md][4]. Violations may be reported to \u003calex@strugee.net\u003e.\n\n## License\n\nLGPL 3.0+\n\n## Author\n\nAJ Jordan \u003calex@strugee.net\u003e\n\n [1]: http://gulpjs.com/\n [2]: https://github.com/straticjs/generator-stratic\n [3]: http://contributor-covenant.org/\n [4]: https://github.com/straticjs/stratic-decorate-files/blob/master/CODE_OF_CONDUCT.md\n [MomentJS]: https://momentjs.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstraticjs%2Fstratic-decorate-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstraticjs%2Fstratic-decorate-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstraticjs%2Fstratic-decorate-files/lists"}