Skip to content

extra-javascript-text.web 0.1.11

Install from the command line:
Learn more about npm packages
$ npm install @nodef/extra-javascript-text.web@0.1.11
Install via package.json:
"@nodef/extra-javascript-text.web": "0.1.11"

About this version

Utilities for processing JavaScript text.
πŸ“¦ Node.js, 🌐 Web, πŸ“œ Files, πŸ“° Docs.

This package is available in both Node.js and Web formats. The web format is exposed as extra_javascript_text standalone variable and can be loaded from jsDelivr CDN.

Stability: Experimental.


const fs         = require('fs');
const javascript = require('extra-javascript-text');


function main() {
  var txt = fs.readFileSync('src/index.ts', 'utf8').replace(/\r?\n/, '\n');

  javascript.importSymbols(txt);
  // []

  javascript.exportSymbols(txt);
  // [
  //   {
  //     full: 'export function tagStrings',
  //     name: 'tagStrings',
  //     kind: 'function',
  //     isDefault: false
  //   },
  //   {
  //     full: 'export function untagStrings',
  //     name: 'untagStrings',
  //     kind: 'function',
  //     isDefault: false
  //   },
  //   ...
  // ]

  javascript.jsdocSymbols(txt);
  // [
  //   {
  //     full: '/**\r\n' +
  //       ' * Get index of string end.\r\n' +
  //       ' * @param txt javascript text\r\n' +
  //       ' * @param i index of string begin\r\n' +
  //       ' */\r\n' +
  //       ' function indexOfClosingString',
  //     jsdoc: '/**\r\n' +
  //       ' * Get index of string end.\r\n' +
  //       ' * @param txt javascript text\r\n' +
  //       ' * @param i index of string begin\r\n' +
  //       ' */',
  //     name: 'indexOfClosingString',
  //     kind: 'function',
  //     isExported: false,
  //     isDefault: false
  //   },
  //   {
  //     full: '/**\r\n' +
  //       ' * Tag strings in javascript text and remove them.\r\n' +
  //       ' * @param txt javascript text\r\n' +
  //       ' * @returns [updated javascript text, tags]\r\n' +
  //       ' */\r\n' +
  //       'export function tagStrings',
  //     jsdoc: '/**\r\n' +
  //       ' * Tag strings in javascript text and remove them.\r\n' +
  //       ' * @param txt javascript text\r\n' +
  //       ' * @returns [updated javascript text, tags]\r\n' +
  //       ' */',
  //     name: 'tagStrings',
  //     kind: 'function',
  //     isExported: true,
  //     isDefault: false
  //   },
  //   ...
  // ]
}
main();


Index

Property Description
tagStrings Tag strings in javascript text and remove them.
untagStrings Untag strings in javascript text by adding them back.
forEachComment Match links in javascript text.
comments Get comments in javascript text.
replaceComments Replace comments in javascript text.
tagComments Tag comments in javascript text and remove them.
untagComments Untag comments in javascript text by adding them back.
uncomment Remove comments from javascript text.
forEachJsdocSymbol Match jsdoc symbols in javascript text.
jsdocSymbols Get jsdoc symbols in javascript text.
replaceJsdocSymbols Replace jsdoc symbols in javascript text.
forEachExportSymbol Match export symbols in javascript text.
exportSymbols Get export symbols in javascript text.
replaceExportSymbols Replace export symbols in javascript text.
forEachImportSymbol Match import symbols in javascript text.
importSymbols Get import symbols in javascript text.
replaceImportSymbols Replace import symbols in javascript text.
correctDeclarations Correct type declarations after generation.



DOI

Details


Assets

  • extra-javascript-text.web-0.1.11-npm.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0