GithubHelp home page GithubHelp logo

kal93 / tsutils Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ajafff/tsutils

0.0 1.0 0.0 277 KB

utility functions for working with typescript's AST

License: MIT License

TypeScript 100.00%

tsutils's Introduction

Utility functions for working with typescript's AST

Greenkeeper badge

Usage

This package consists of two major parts: utilities and typeguard functions. By importing the project you will get both of them.

import * as utils from "tsutils";
utils.isIdentifier(node); // typeguard
utils.getLineRanges(sourceFile); // utilities

If you don't need everything offered by this package, you can select what should be imported. The parts that are not imported are never read from disk and may save some startup time and reduce memory consumtion.

If you only need typeguards you can explicitly import them:

import { isIdentifier } from "tsutils/typeguard";
// You can even distiguish between typeguards for nodes and types
import { isUnionTypeNode } from "tsutils/typeguard/node";
import { isUnionType } from "tsutils/typeguard/type";

If you only need the utilities you can also explicitly import them:

import { forEachComment, forEachToken } from "tsutils/util";

Typescript version dependency

This package is backwards compatible with typescript 2.1.0 at runtime although compiling might need a newer version of typescript installed.

Using typescript@next might work, but it's not officially supported. If you encounter any bugs, please open an issue.

tsutils's People

Contributors

ajafff avatar andy-hanson avatar dmiller9911 avatar greenkeeper[bot] avatar weswigham avatar

Watchers

 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.