1.0.11 • Published 3 years ago
clang-tools-wrapper v1.0.11
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))