
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
gulp-embed-json
Advanced tools
Gulp plugin to inline/embed JSON data into HTML files.
npm i --save-dev gulp-embed-json
const embedJSON = require('gulp-embed-json');
gulp.task('embedJSON', () =>
gulp.src('*.html')
.pipe(embedJSON())
.pipe(gulp.dest('dist/')));
This gulp task will inline/embed any scripts with JSON source attribute and respective mime type.
string | Array<string>
Provide custom mime types to specify which <script>
tags should be embedded.
application/json, application/ld+json
type="application/ld+json"
HTML layout
<html>
<head><!-- ... --></head>
<body>
<!-- ... -->
<script type="application/json" src="data.json"></script>
<script type="application/ld+json" src="structured-data.json"></script>
<!-- ... -->
</body>
</html>
Gulp task
const embedJSON = requrie('gulp-embed-json');
// ...
gulp.task('embedJSON', () =>
gulp.src('*.html')
.pipe(embedJSON({
mimeTypes: 'application/ld+json'
}))
.pipe(gulp.dest('dist/')));
Output
<html>
<head><!-- ... --></head>
<body>
<!-- ... -->
<script type="application/json" src="data.json"></script>
<script type="application/ld+json"><!-- contents of structured-data.json --></script>
<!-- ... -->
</body>
</html>
string
Provide the directory root where JSON files are located.
__dirname
The folder in which the module is executed.
HTML layout
<html>
<head><!-- ... --></head>
<body>
<!-- ... -->
<script type="application/json" src="data.json"></script>
<!-- ... -->
</body>
</html>
Folder structure
/src
index.html
gulpfile.js
/assets
/json
data.json
Gulp task
const embedJSON = requrie('gulp-embed-json');
// ...
gulp.task('embedJSON', () =>
gulp.src('*.html')
.pipe(embedJSON({
root: './assets/json'
}))
.pipe(gulp.dest('dist/')));
string
Provide the encoding of your JSON files.
utf8
1.0.0
FAQs
Gulp plugin to inline/embed JSON data into HTML files.
The npm package gulp-embed-json receives a total of 1 weekly downloads. As such, gulp-embed-json popularity was classified as not popular.
We found that gulp-embed-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.