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

ts-code-layout

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-code-layout

Changes the layout of typescript files.

Source
npmnpm
Version
1.3.0
Version published
Weekly downloads
1
-95%
Maintainers
1
Weekly downloads
 
Created
Source

Name

ts-code-layout: Rearranges elements in typescript code.

Synopsis

  ts-code-layout -i input-directory -o output-directory [-s] sources ...

Description

Rearranges code elements in the top level of typescript source code. The layout is specified in "ts-code-layout.json". The file is searched in the current directory. If not found, the default configuration in the installation directory is used.

Installation

  npm install ts-code-layout

Options

  -i, --input-directory string    Input-directory to read scripts from. 
  -o, --output-directory string   Output-directory to write scripts to. 
  -s, --scripts string[]          Scripts to be processed.              
  -p, --pause                     Pause before closing the app.         
  -w, --write-options             Writes options to "options.txt"

Configuration

The elements are sorted by following traits:

  • "kind": Based on the kind of element (enumeration, class, function, ...).
  • "transfer": Based on whether elements are exported or not.
  • "persistance": Based on whether elements are constant or not.
  • "pattern": Based on whether an element matches patterns or not.
  • "name": Based on the alphabetical sorting of the name of the element.

Possible values:

  • "kind": "Header", "Import", "TypeImport", "Enumeration", "Type", "Interface", "Variable", "Class", "Function"
  • "transfer": "IsExported"
  • "persistance": "IsConstant"
  • "pattern": One or more regular expressions
  • "name": -

In all traits (except "name") the value "null" can also be used. A value of "null" means that the values of the corresponding trait do not apply to the element.

When comparing the elements, the order in which the traits are specified in the configuration is taken into account.

Example

  {
    "comparisons": 
    [
      { "kind": ["Header", "Import", "TypeImport", "Enumeration", "Type", "Interface", "Variable", "Class", "Function", null] },
      { "transfer": [ "IsExported", null ] },
      { "persistance": [ "IsConstant", null ] },
      { "pattern": ["const option[a-zA-Z]+ = \"[-a-zA-z]+\";", null], "ignoreIfSingleLine": false },
      { "name": [], "ignoreIfSingleLine": true }
    ]
  }

FAQs

Package last updated on 25 Aug 2023

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