parse-php-to-json
v1.0.2
Published
Convert PHP files into JSON file representations. Namespaces are structured as directories.
Downloads
3
Readme
Parse PHP to JSON
Convert PHP files into JSON file representations. Namespaces are structured as directories. To be used for building other applications that need to quickly and easily parse PHP source code.
See Projects that use parse-php-to-json
- Parse PHP to Markdown - used for building GitHub project wikis (written in Node)
- Render Docs - web server that dynamically displays documentation for PHP srouce code (written in PHP)
Example Use
const parser = require('parse-php-to-json');
console.time();
parser({
include: ['/some/path/to/src', '.php'],
exclude: ['vendor',],
dest: __dirname + '/json',
encoding: 'utf-8',
meta: {
name: "Some Project",
description: "Some long description..."
},
}, function (toc, search) {
// Callback when completed
console.log(toc); // contents of the Table of Contents file
console.log(search); // contents of the Search file
console.log('Done!');
console.timeEnd();
});