ctagz.js
function findCTagsBSearch(searchPath, tag, ignoreCase = false, tagFilePattern = '{.,}tags') {
    const ctags = findCTagsFile(searchPath, tagFilePattern)
        .disposer(tags => {
            if (tags) {
                tags.destroy()
            }
        })

    return Promise.using(ctags, tags => {
        if (tags) {
            return tags.init()
                .then(() => tags.findBinary(tag, ignoreCase))
                .then(result => ({ tagsFile: tags.tagsFile, results: result }))
        }
        return { tagsFile: '', results: [] }
    })
}
function findCTagsBSearch(searchPath, tag, ignoreCase = false, tagFilePattern = '{.,}tags') {
    const ctags = findCTagsFile(searchPath, tagFilePattern)
        .disposer(tags => {
            if (tags) {
                tags.destroy()
            }
        })

    return Promise.using(ctags, tags => {
        if (tags) {
            return tags.init()
                .then(() => tags.findBinary(tag, ignoreCase))
                .then(result => ({ tagsFile: tags.tagsFile, results: result }))
        }
        return { tagsFile: '', results: [] }
    })
}
function findCTagsBSearch ( searchPath , tag , ignoreCase = false , tagFilePattern = '{.,}tags' ) { const ctags = findCTagsFile ( searchPath , tagFilePattern ) . disposer ( tags => { if ( tags ) { tags . destroy ( ) } } ) return Promise . using ( ctags , tags => { if ( tags ) { return tags . init ( ) . then ( ( ) => tags . findBinary ( tag , ignoreCase ) ) . then ( result => ( { tagsFile : tags . tagsFile , results : result } ) ) } return { tagsFile : '' , results : [ ] } } ) }
Finds the CTags file from the specified search pattern and
searches it for the specified tag
@param {string} searchPath The path to search for the tags file
@param {string} tag The tag to search for in the tags file
@param {bool}   ignoreCase Whether or not to ignore case when searching
@param {string} tagFilePattern The pattern to use when looking for
the tags file (refer to findCTagsFile)
@return {any[]} A promise, resolving to a list of found entries,
or an empty array if none found
Finds the CTags file from the specified search pattern and searches it for the specified tag