New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@jf/index

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jf/index

Build index of EcmaScript/CommonJS package.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

@jf/index stable

Build index of EcmaScript package. Index file can be used as entry key of webpack configuration.

Features

  • You can use your own template using -t option.
  • It's a class, so you can extend it and overwrite any method.

Usage

npm install @jf/index

node jf-index -i /path/to/srcdir

Some info can be retrieved from package.json:

node jf-index -i /path/to/srcdir -p /path/to/package.json

Example

Directory tree:

└─┬ base.mjs
  └─┬ type
    └─┬ base.mjs
      ├─┬ collection
      │ ├── base.mjs
      │ └── users.mjs
      └─┬ item
        ├── base.mjs
        └── user.mjs

EcmaScript

Index generated:

import Base                from './base.mjs';
import TypeBase            from './type/base.mjs';
import TypeCollectionBase  from './type/collection/base.mjs';
import TypeCollectionUsers from './type/collection/users.mjs';
import TypeItemBase        from './type/item/base.mjs';
import TypeItemUser        from './type/item/user.mjs';
/**
 * Archivo índice creado con `@jf/index`.
 *
 * @author  Joaquín Fernández
 * @created Fri Apr 21 2017 00:25:03 GMT+0200 (CEST)
 * @version 0.1
 */
export default {
    Base : Base,
    type : {
        Base : TypeBase,
        collection : {
            Base : TypeCollectionBase,
            Users : TypeCollectionUsers
        },
        item : {
            Base : TypeItemBase,
            User : TypeItemUser
        }
    }
};

NodeJS

Index generated:

const Base                = require('./base.mjs');
const TypeBase            = require('./type/base.mjs');
const TypeCollectionBase  = require('./type/collection/base.mjs');
const TypeCollectionUsers = require('./type/collection/users.mjs');
const TypeItemBase        = require('./type/item/base.mjs');
const TypeItemUser        = require('./type/item/user.mjs');
/**
 * Archivo índice creado con `@jf/index`.
 *
 * @author  Joaquín Fernández
 * @created Fri Apr 21 2017 00:25:03 GMT+0200 (CEST)
 * @version 0.1
 */
module.exports = {
    Base : Base,
    type : {
        Base : TypeBase,
        collection : {
            Base : TypeCollectionBase,
            Users : TypeCollectionUsers
        },
        item : {
            Base : TypeItemBase,
            User : TypeItemUser
        }
    }
};

FAQs

Package last updated on 17 Apr 2019

Did you know?

Socket

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.

Install

Related posts