Giter VIP home page Giter VIP logo

dimic's Introduction

dimic

Node.js CLI to create pathmap index module from directory structure.

From

|-src
  |-assets
    |- font
      |- aldrich.woff
    |- image
      |- player.png
      |- enemy.png

๐Ÿ‘‡ To

// src/assets/index.js
import mod_0 from "./font/aldrich.woff";
import mod_1 from "./image/player.png";
import mod_2 from "./image/enemy.png";
export default {
  font: {
    aldrich: mod_0,
  },
  image: {
    player: mod_1,
    enemy: mod_2,
  },
};

Requirements

Node.js v10.10.0+

Install

npm install dimic -g

Usage

dimic [--options]

Options

Change input(target) directory

dimic -i public/static

Default input directory is src/assets/, but you can change this by --input-dir (-i in short) option.

Change output file name

dimic -o index.ts

Default output file name is index.js, but you can change this by --output-file (-o in short) option.

Watch changes
dimic --watch

Add this option if you want to output file in accordance with directory change. (-w in short)

Filter files

dimic --match *

You can filter files/directories to be mapped by adding --match option.
Use glob pattern to set value.

Default is !_*, which means files/dirs starting from "_" are ignored.

Development

Test

npm run test

dimic's People

Contributors

pentamania avatar

Stargazers

Negiwine avatar  avatar uttk avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.