npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-filemap-generator

v0.0.5

Published

auto generate filemap for development

Downloads

16

Readme

gulp-filemap-generator

  • auto generate filemap for development.
  • It finds Web page files in the project and collects the path, file name and meta tag.

빌드된 폴더 내에 웹페이지파일(html)을 찾아 경로와 파일명 그리고 메타태그(title,author,description)를 수집합니다. 그리고 템플릿 파일을 기준으로 file-tree 생성합니다. (lodash)

It finds files in the built folder, collects path, file name, and meta tag(title,author,description). And it creates a tree file-tree on the template file. (lodash)

(html 파일명을 한글로 작성하지 마세요!)

(Do not write the file name in Korean.)

Installation

Code Example

gulpfile.js

const filemap = require('gulp-filemap-generator');

gulp.task('filemap', () => {
    return gulp.src([`/dest/**/*.html`])
        .pipe(filemap({
            'template':`map.html`, //*required : filemap template
            'templatePath' : `./source`, //*required : template file path
        }))
        .pipe(gulp.dest(`/dest`))
});

webpage in your dest folder

return file-tree

[
    {
        "type" : "folder",
        "folderName" : "app",
        "parentPath" : "default : option.directory",
        "depth" : 1,
        "children" : [
            {
                "type" : "folder",
                "folderName" : "html",
                "parentPath" : "app",
                "depth" : 2,
                "children" : [
                    {
                        "type" : "file",
                        "fileName" : "c.html",
                        "parentPath" : "html",
                        "depth" : 3,
                        "data" : {
                            "title" : "option.title (default : - )",
                            "author" : "option.author (default : - )",
                            "description" : "option.description (default : - )",
                            "href" : "/app/html/c.html"
                        }
                    },
                    {
                        "type" : "folder",
                        "folderName" : "sub1-1",
                        "parentPath" : "html",
                        "depth" : 3,
                        "children" : [
                            "..."
                        ]
                    }
                ]
            }
        ]
    }
]

Write a lodash template (example)

<div class="wrap">
    <h1 class="title">gulp-filemap-generator</h1>
    <h2><i class="far fa-folder"></i> root (build)</h2>
    <div class="map_tree">
        <!--
            maps라는 변수(array)로 파일맵이 반환됩니다. 이것을 기준으로 template을 그려넣으세요.

            The file map is returned by a variable called maps (type:array).
        -->

        <!--
            <% _.each(maps,function(map,index){ %>
            <% }) %>
        -->
    </div>
</div>  

map.html after build (sample)

<div class="wrap">
    <h1 class="title">gulp-filemap-generator</h1>
    <h2><i class="far fa-folder"></i> root 폴더 (build)</h2>
    <div class="map_tree">
        <h2 class="page"><i class="far fa-folder"></i> html</h2>
        <ul class="file_list">
            <li>
                <div class="file_info">
                    <span>
                        <i class="far fa-file-code"></i>
                        <a href="\html\test.html" class="txt" target="_blank">/test.html</a>
                    </span>
                    <span>타이틀(함수형-프로그래밍 기초)</span>
                    <span>작업자(최승희)</span>
                    <span>설명(함수형-프로그래밍)</span>
                </div>
            </li>
            <li>
                <span><i class="far fa-folder"></i> 20180318/</span>
                <ul class="file_list">
                    <li>
                        <div class="file_info">
                            <span>
                                <i class="far fa-file-code"></i>
                                <a href="\html\20180318\functional-programming-1.html" class="txt"
                                    target="_blank">functional-programming-1.html</a>
                            </span>
                            <span>타이틀(함수형-프로그래밍 기초)</span>
                            <span>작업자(최승희)</span>
                            <span>설명(함수형-프로그래밍)</span>
                        </div>
                    </li>
                    <li>
                        <div class="file_info">
                            <span>
                                <i class="far fa-file-code"></i>
                                <a href="\html\20180318\functional-programming-2.html" class="txt"
                                    target="_blank">functional-programming-2.html</a>
                            </span>
                            <span>타이틀(함수형-프로그래밍 기초)</span>
                            <span>작업자(최승희)</span>
                            <span>설명(함수형-프로그래밍)</span>
                        </div>
                    </li>
                </ul>
            </li>
            <li>
                <span><i class="far fa-folder"></i> 20181017/</span>
                <ul class="file_list">
                    <li>
                        <div class="file_info">
                            <span>
                                <i class="far fa-file-code"></i>
                                <a href="\html\20181017\flex_test.html" class="txt"
                                    target="_blank">flex_test.html</a>
                            </span>
                            <span>타이틀(flex를 익혀봅시다.)</span>
                            <span>작업자(최승희 flex)</span>
                            <span>설명(flex를 익혀봅시다.)</span>
                        </div>
                    </li>
                </ul>
            </li>
            <li>
                <span><i class="far fa-folder"></i> 20190321/</span>
                <ul class="file_list">
                    <li>
                        <div class="file_info">
                            <span>
                                <i class="far fa-file-code"></i>
                                <a href="\html\20190321\structures&algorithms.html" class="txt"
                                    target="_blank">structures&algorithms.html</a>
                            </span>
                            <span>타이틀(자바스크립트 - 자료구조와 알고리즘)</span>
                            <span>작업자(최승희)</span>
                            <span>설명(자료구조와 알고리즘)</span>
                        </div>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
</div>

Options

    {
        'listName', 'maps', //file-tree name
        'baseDir':``, //href base directory
        'template':`map.html`, //template file name (lodash)
        'templatePath' : `./`, //template file path
        'title':'-', //default html title
        'author':'-', //default author name
        'description':'-', //default html description
        'stream' : false, //Only the map.html file passes through the stream. (true: All files)
        "hrefBaseDir" : '', //Deletes unwanted characters from the current directory and generates an address.
        "toJson" : 'default false', //Instead of use template, it generate json file
        "jsonName" : "map", //json file name
        "jsonDest" : `./build`
    }

License

[email protected]