Socket
Socket
Sign inDemoInstall

extra-javascript-text.web

Package Overview
Dependencies
0
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    extra-javascript-text.web

Utilities for processing JavaScript text{web}.


Version published
Weekly downloads
23
increased by666.67%
Maintainers
1
Install size
28.1 kB
Created
Weekly downloads
 

Readme

Source

Utilities for processing JavaScript text.
📦 Node.js, 🌐 Web, 📜 Files, 📰 Docs.

This package is available in Node.js and Web formats. To use it on the web, simply use the extra_javascript_text global variable after loading with a <script> tag from the jsDelivr CDN.

Stability: Experimental.


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


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

  xjavascript.importSymbols(txt);
  // []

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

  xjavascript.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

PropertyDescription
tagStringsTag strings in javascript text and remove them.
untagStringsUntag strings in javascript text by adding them back.
forEachCommentMatch links in javascript text.
commentsGet comments in javascript text.
replaceCommentsReplace comments in javascript text.
tagCommentsTag comments in javascript text and remove them.
untagCommentsUntag comments in javascript text by adding them back.
uncommentRemove comments from javascript text.
forEachJsdocSymbolMatch jsdoc symbols in javascript text.
jsdocSymbolsGet jsdoc symbols in javascript text.
replaceJsdocSymbolsReplace jsdoc symbols in javascript text.
forEachExportSymbolMatch export symbols in javascript text.
exportSymbolsGet export symbols in javascript text.
replaceExportSymbolsReplace export symbols in javascript text.
forEachImportSymbolMatch import symbols in javascript text.
importSymbolsGet import symbols in javascript text.
replaceImportSymbolsReplace import symbols in javascript text.
correctDeclarationsCorrect type declarations after generation.



ORG DOI

Keywords

FAQs

Last updated on 11 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc