How to use the @jsdoc/core.fs function in @jsdoc/core

To help you get started, we’ve selected a few @jsdoc/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hegemonic / jsdoc-baseline / lib / template.js View on Github external
Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
/** @module lib/template */

const _ = require('lodash');
const beautify = require('js-beautify').html;
const config = require('./config');
const deepExtend = require('deep-extend');
const handlebars = require('handlebars');
const handlebarsLayouts = require('handlebars-layouts');
const loader = require('./loader');
const { lsSync } = require('@jsdoc/core').fs;
const MessageFormat = require('messageformat');
const logger = require('jsdoc/util/logger');
const path = require('path');
const { readFileSync } = require('fs');
const yaml = require('js-yaml');

// Maximum file size that we'll try to beautify.
const MAX_BEAUTIFY_SIZE = 1024 * 128;

function loadYaml(filepath) {
    let parsedObject;

    try {
        if (filepath) {
            parsedObject = yaml.load(readFileSync(filepath, 'utf8'));
        }
github jsdoc / jsdoc / packages / jsdoc / lib / jsdoc / src / scanner.js View on Github external
/**
 * @module jsdoc/src/scanner
 */
const { EventEmitter } = require('events');
const logger = require('jsdoc/util/logger');
const { lsSync } = require('@jsdoc/core').fs;
const path = require('path');
const { statSync } = require('fs');

/**
 * @extends module:events.EventEmitter
 */
class Scanner extends EventEmitter {
    constructor() {
        super();
    }

    /**
     * Recursively searches the given searchPaths for js files.
     * @param {Array.} searchPaths
     * @param {number} [depth]
     * @fires sourceFileFound

@jsdoc/core

Core functionality for JSDoc.

Apache-2.0
Latest version published 7 months ago

Package Health Score

70 / 100
Full package analysis