gulp generate pug templates from JSON array

I have a JSON array containing information for different sub pages for a website. I’m already using gulp for the build process, and I want to compile a template pug file into multiple pages based on this JSON file.

const plugins = require('gulp-load-plugins')()
const gulp = require('gulp')
const es = require('event-stream')
const projects = require('./src/projects.json')

gulp.task('projects', () => {
  // Walk through all projects in JSON
  let streams = => {
    return gulp.src('src/templates/project.pug')
      // Set project as a locals object for template generation
      .pipe( => ({project: project})))
      // Name the file after the project
      .pipe(plugins.rename(path.join( + '.html')))
  // Merge all streams and output to files
    .pipe(gulp.dest(path.join(paths.dist, 'projects')))