Socket
Socket
Sign inDemoInstall

dynamic-package-update

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dynamic-package-update

A simple node.js module for dynamic updating packages list in the markdown file.


Version published
Maintainers
1
Created

Readme

Source

dynamic-package-update

NPM Version NPM Downloads GitHub release License

A simple node.js module for dynamic updating packages list in the markdown file.

Installation

Prerequisites

  • Node.js >= 10.0.0

Install Package


# With NPM

npm install --save dynamic-package-update

# With Yarn

yarn add dynamic-package-update

// Available options

const dpu = require("dynamic-package-update");

const option = {
    outPutFileName: 'docs.md',              // Default is README.md
    packageJsonFile: 'your json file',      // Default your root package.json file no need to set this option. 
    showNpmLinkColumn: true,                // Default is true.
    showTypeColumn: true,                   // Default is true.
    showDependencies: true,                 // Default is true.
    showDevDependencies: true               // Default is true.
}

// Note: By default option is an optional parameter.

dpu.generateTableMarkDown(readmefile, option);

Examples

Create a readme.js file for updating README.md file.

Folder structure with readme.js:

    +-- node_modules
    +-- src
    |   +-- index.js
    |   +-- file1.js
    |   +-- file1.js
    +-- package.json
    +-- package-lock.json
    +-- readme.js
    +-- README.md

// readme.js

const dpu = require("dynamic-package-update");
const fs = require('fs');
const path = require('path');

const readmefile = fs.readFileSync(path.join(__dirname, "README.md"), "utf8");
dpu.generateTableMarkDown(readmefile);

Notes:
- Add this below html code in anywhere in your README.md file.
- Don't add anything inside this content div.
- It will automatically inject package list from your package.json file.
- Along with package list, It will automatically add  Package List as a title tag. Don't add it explicitely.

<!--README.md-->

<div id="content">
</div>
// package.json

  "scripts": {
    "start": "node src/index.js",
    "readme:dpu": "node readme.js"
  },


npm run readme:dpu     #This will automatically update package list in the README.md file

Package Insights

Build

npm install             #For installing dependencies

npm build               #For making build

Package List

Package NameVersionTypeNpm Link
@types/node^20.8.7devDependencies@types/node
lint-staged^15.0.2devDependencieslint-staged
prettier^3.0.3devDependenciesprettier
typescript^5.2.2devDependenciestypescript
husky^8.0.0devDependencieshusky
Note: The build artifacts will be stored in the `dist/` directory.

Contributors

License

MIT

Free Software

Keywords

FAQs

Last updated on 20 Oct 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