Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gulp-makejson with all npm packages installed. Try it out:

var gulpMakejson = require("gulp-makejson")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gulp-makejson v1.0.4

creates json from source files and pipes the resulting json down to the next plugin

gulp-makejson

creates json from source files and pipes the resulting json down to the next plugin

Buildstatus/Dependencies

Build Status Dependency Status devDependency Status

Usage

var gulp = require("gulp");
var gulpMakeJson = require('gulp-makejson');

gulp.task("myTask", function() {
    gulp.src("./markdown/**/*.md") //markdown is just an example here. Can be any kind of textfiles.
    .pipe(gulpMakeJson()) // packs all the html stuff in nice json format
    .pipe(gulp.dest("./build/"))
});

The task will create a json of all files in the pipeline in the following way:

{
    "myfirstfile.md": "#mytitle\nThis is the first paragraph",
    "subfolder/mysecondfile.md": "#mytitle\nThis is the second paragraph"
}

Note: Using this plugin will currently result in only one json file being emitted. Note: The key will reflect the relative path of a file

Feel free to contribute. Pull requests will be reviewed in a timely manner.

About the authors:

Project Phase

Support Us

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free