npm.io
1.0.11 • Published 5 years ago

clang-tools-wrapper

Licence
ISC
Version
1.0.11
Deps
0
Size
11 kB
Vulns
0
Weekly
0
Stars
2
DeprecatedThis package is deprecated
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

Clang Tools Wrapper

Installation

npm i clang-tools-wrapper

Description

Wrapper clang-tools-extra package for JavaScript

Clang Format

Utility for formatting C/C++, JavaScript, TypeScript code

Platform Architecture Status
Windows x32 Completed
Windows x64 Completed
Linux x32 Completed
Linux x64 Completed
MacOs x32 Completed
MacOs x64 Completed
Clang Query

Utility for inspecting the Clang AST and assist in the construction of AST Matcher expressions.

Platform Architecture Status
Windows x32 In progress
Windows x64 In progress
Linux x32 In progress
Linux x64 In progress
MacOs x32 In progress
MacOs x64 In progress
Clang Tidy

Utility for static analysis of source code and recognition of program bottlenecks

Platform Architecture Status
Windows x32 In progress
Windows x64 In progress
Linux x32 In progress
Linux x64 In progress
MacOs x32 In progress
MacOs x64 In progress

Usage

Examples of usage clang-tools-wrapper library

Clang Format
const { ClangFormat, options, environment } = require('clang-tools-wrapper')

const { join } = require('path')
const fs = require('fs')

const filedir = join(process.cwd(), 'tests')
const filepath = join(filedir, 'sample.cpp')
const content = fs.readFileSync(filepath)

const editorConfig = options.generateEditorConfig(filepath, 0, 'LLVM', 'Google')
const execConfig = options.generateExecConfig(content, filedir)

const clangFormat = new ClangFormat(environment)

console.log(clangFormat.format(editorConfig, execConfig))

Keywords