You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

doxdox-fetch

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doxdox-fetch

> Fetch utilities for doxdox server.

3.1.0
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

doxdox-fetch

Fetch utilities for doxdox server.

NPM version NPM downloads per month doxdox documentation

Install

$ npm install doxdox-fetch --save

Usage

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

.env

GITHUB_API_TOKEN_READONLY=xxxxx

package.json

{
  "type": "module",
  "dependencies": {
    "doxdox-fetch": "2.0.0"
  },
  "devDependencies": {
    "dotenv": "16.0.0"
  },
  "scripts": {
    "test": "node -r dotenv/config index.js"
  },
  "private": true
}

index.js

import { downloadFile, getRepoData, parseFiles } from 'doxdox-fetch';

import { parseString } from 'doxdox-parser-custom';

import { Doc } from 'doxdox-core';

(async () => {
  const repoData = await getRepoData(username, repo, {
    GITHUB_API_TOKEN: process.env.GITHUB_API_TOKEN_READONLY
  });

  const selectedBranch =
    branch && [repoData.default_branch, ...repoData.tags].includes(branch)
      ? branch
      : repoData.default_branch;

  const files = await downloadFile(username, repo, selectedBranch, [
    /.[jt]s$/,
    /package.json$/,
    /\.doxdoxignore$/
  ]);

  const jsFiles = files.filter(
    ({ path }) =>
      path.match(/\.[jt]sx?$/) &&
      !path.match(/\.min\.[jt]sx?$/) &&
      !path.match(/\.test\.[jt]sx?$/) &&
      !path.match(/^dist\//) &&
      !path.match(/__tests__\//)
  );

  const pkgFile = files.find(({ path }) => path.match(/^package\.json$/));

  const pkgFileContents = JSON.parse(pkgFile?.content || '{}');

  const doc: Doc = {
    name: pkgFileContents.name || repoData.name,
    description: pkgFileContents.description || repoData.description,
    homepage: pkgFileContents.homepage || repoData.html_url,
    files: await parseFiles(jsFiles, parseString)
  };

  console.log(doc);
})();

Keywords

doxdox

FAQs

Package last updated on 20 May 2025

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.