GithubHelp home page GithubHelp logo

ftdetect's Introduction

ftdetect

ftdetect is a library for detecting the filetype of source code files (what programming language the file is written in). It primarily uses the file extension and file name to determine the filetype, but also may use the first line of the file (the header) for additional information (for example, #!/bin/bash on the first line is a good indication of a shell file, even if there is no extension).

The library is optimized for very fast detection in the common case and supports saving the detection data structure to a file for very fast loading/startup time.

A default set of detectors for 135 different languages is provided. If you would like to do the embedding yourself you can specify the ftdetect_custom build tag to avoid embedding the default detectors.

The ./cmd/detect directory contains an example tool which uses the default detectors to perform file detection on the first argument to the CLI application.

ftdetect's People

Contributors

zyedidia avatar

Stargazers

sudo rm -rf --no-preserve-root / avatar Thomas Leary avatar Rob avatar vikramarsid avatar Jorge Gomez avatar Daniel Correia avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

jgarte

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.