New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ctix

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ctix

Automatic create index.ts file

  • 0.1.1-beta
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4K
decreased by-14.04%
Maintainers
1
Weekly downloads
 
Created
Source

ctix

Download Status Github Star Github Issues NPM version License cti

Install

npm install ctix --save-dev

Introduction

when you develop package for another application using TypeScript, that is compiled using by webpack, babel. webpack very popular tool for bundling. At this time you need bundle entrypoint called by index.ts.

Manage export file, not so convenience. If you add file or class, function you rewrite export file over and over again. ctix help this work. ctix read .npmignore, .ctiignore file after ignore there also you can use exclude configuration in tsconfig.json. See below example,

  src/
    app.ts
    component/
      Nav.ts
      Button.ts

ctix create sub-command create index.ts file below.

  src/
    app.ts
    > index.ts
      // created from 'ctix'
      export * from './component';
      export * from './app';
    component/
      Nav.ts
      Button.ts
      > index.ts
        // created from 'ctix'
        export * from './Nav';
        export * from './Button';

ctix single mode generate single file. This file suitable for webpack entrypoint.

  src/
    app.ts
    component/
      Nav.ts
      Button.ts
  > entrypoint.ts
    // created from 'ctix'
    export * from './src/app.ts'
    export * from './src/component/Nav.ts'
    export * from './src/component/Button.ts'

Why ctix?

Pros

  1. pass tsconfig.json file, another process don't care about
  2. Support default exportation
    • my_default_index.test.ts file create export { default as myDefaultIndexTest } from './my_default_index.test'

Cons

  1. Something slow some project
    • ctix use TypeScript compiler API, big project some slow

Usage

create mode

ctix create ./tsconfig.json or ctix create -p ./tsconfig.json

single mode

ctix single ./tsconfig.json or ctix single -p ./tsconfig.json

clean mode

ctix clean ./tsconfig.json or ctix clean -p ./tsconfig.json

init mode

ctix init ./tsconfig.json or ctix init -p ./tsconfig.json

CLI with .ctirc

ctix cli support .ctirc configuration file. Available name is only .ctirc. .ctirc configuration file can applied by each target directories and script working directory. Every configuration overwrited same feature. Also cti cli arguments forced applied. And .ctirc file can write json5 format. json5 spec. can comment and more feature.

.ctirc creation

You can use cli for .ctirc file creation.

# create current directory
> cti init

# create multiple directory
> cti init ./example/type03 ./example/type02

Language

FAQs

Package last updated on 20 Aug 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc