{"id":19460408,"url":"https://github.com/haensl/gulp-minify-inline-json","last_synced_at":"2025-04-25T07:33:07.362Z","repository":{"id":26895709,"uuid":"110761645","full_name":"haensl/gulp-minify-inline-json","owner":"haensl","description":"Minifies inline \u003cscript\u003e tags containing JSON data, i.e. application/json and application/ld+json.","archived":false,"fork":false,"pushed_at":"2024-06-11T08:51:26.000Z","size":367,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-30T16:51:45.697Z","etag":null,"topics":["gulp","gulp-plugin","gulpplugin","html","inline","json","minify","npm","script"],"latest_commit_sha":null,"homepage":null,"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/haensl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["haensl"]}},"created_at":"2017-11-15T00:22:01.000Z","updated_at":"2023-10-02T09:37:07.000Z","dependencies_parsed_at":"2024-06-21T17:32:13.061Z","dependency_job_id":null,"html_url":"https://github.com/haensl/gulp-minify-inline-json","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":0.4864864864864865,"last_synced_commit":"72f5af764a028aae4e327c47aeeb4642b753fdf6"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haensl%2Fgulp-minify-inline-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haensl%2Fgulp-minify-inline-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haensl%2Fgulp-minify-inline-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haensl%2Fgulp-minify-inline-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haensl","download_url":"https://codeload.github.com/haensl/gulp-minify-inline-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223989812,"owners_count":17237158,"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","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","gulpplugin","html","inline","json","minify","npm","script"],"created_at":"2024-11-10T17:37:05.924Z","updated_at":"2024-11-10T17:37:06.389Z","avatar_url":"https://github.com/haensl.png","language":"JavaScript","funding_links":["https://github.com/sponsors/haensl"],"categories":[],"sub_categories":[],"readme":"# gulp-minify-inline-json\n\n[![NPM](https://nodei.co/npm/gulp-minify-inline-json.png?downloads=true)](https://nodei.co/npm/gulp-minify-inline-json/)\n\n[![npm version](https://badge.fury.io/js/gulp-minify-inline-json.svg)](http://badge.fury.io/js/gulp-minify-inline-json)\n[![CircleCI](https://circleci.com/gh/haensl/gulp-minify-inline-json.svg?style=svg)](https://circleci.com/gh/haensl/gulp-minify-inline-json)\n\nMinifies inline `\u003cscript\u003e` tags containing JSON data, i.e. `application/json` and `application/ld+json`.\n\n## Installation\n\n```shell\nnpm i --save-dev gulp-minify-inline-json\n```\n\n## Usage\n\n```javascript\nconst minifyInlineJSON = require('gulp-minify-inline-json');\n\ngulp.task('minifyInlineJSON', () =\u003e\n  gulp.src('*.html')\n    .pipe(minifyInlineJSON())\n    .pipe(gulp.dest('dist/')));\n```\n\n## Options\n\n### mimeTypes `Array\u003cstring\u003e`\n\nProvide custom mime types to specify which `\u003cscript\u003e` tags to minify.\n\n##### default: `[ 'application/json', 'application/ld+json' ]`\n\n##### Example: Minify only tags with `type=\"application/ld+json\"`\n\n###### HTML Layout\n```html\n\u003chtml\u003e\n  \u003chead\u003e\u003c!-- ... --\u003e\u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- ... --\u003e\n    \u003cscript type=\"application/json\"\u003e{\n      \"some\": \"json\"\n    }\u003c/script\u003e\n    \u003cscript type=\"application/ld+json\"\u003e{\n      \"foo\": \"bar\"\n    }\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n###### Gulp task\n```javascript\n  const minifyJSON = require('gulp-minify-inline-json');\n\n  gulp.task('minifyJSON', () =\u003e\n    gulp.src('*.html')\n      .pipe(minifyJSON({\n        mimeTypes: [\n          'application/ld+json'\n        ]\n      }))\n      .pipe(gulp.dest('dist/')));\n```\n\n###### Output\n```html\n\u003chtml\u003e\n  \u003chead\u003e\u003c!-- ... --\u003e\u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- ... --\u003e\n    \u003cscript type=\"application/json\"\u003e{\n      \"some\": \"json\"\n    }\u003c/script\u003e\n    \u003cscript type=\"application/ld+json\"\u003e{\"foo\":\"bar\"}\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## [Changelog](CHANGELOG.md)\n\n## [License](LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaensl%2Fgulp-minify-inline-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaensl%2Fgulp-minify-inline-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaensl%2Fgulp-minify-inline-json/lists"}