0.1.8 • Published 5 years ago
head2json v0.1.8
C++ Header Parser
Installation
With npm installed, do
$ npm install head2jsonExample
So you have a file example.cpp:
/*
 INT: 1
 STRING: String
 List: 
    - ListItem1
    - ListItem2
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
    cout <<"Hello World\n";
    return 0;
}In your NodeJS file,
const parseHeader = require('head2json');
console.log(parseHeader('./example.cpp'))The result is
{ 
    "INT": 1, 
    "STRING": "String", 
    "List": [ "ListItem1", "ListItem2" ] 
}0.1.8
5 years ago