Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vladholubiev/aws-news-post-formatter

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vladholubiev/aws-news-post-formatter

Formats & fixes HTML from AWS News API; Extracts custom tags based on the headline

  • 2.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

aws-news-post-formatter CircleCI

Fixes HTML from AWS News API and converts it to a clean html, markdown and text; Extracts custom tags based on the headline

Install

$ yarn add @vladholubiev/aws-news-post-formatter

Usage

It is meant to be used to prettify outputs of HTML from aws-news-api-client.

It also parses custom tags based on the post headline.

const {getPostBody, getCustomTags} = require('@vladholubiev/aws-news-post-formatter');

getPostBody('<p>Some HTML</p>'); // returns {html, markdown, text}

getCustomTags('AWS Fargate Supports Container Workloads Regulated By ISO, PCI, SOC, and HIPAA'); // ['iso', 'pci-dss', 'soc', 'hipaa']

Things this library does with HTML formatting

  • Normalizes relative URLs to absolute URLs
  • Removes all style attributes, style tags, class attributes
  • Normalizes tables to be full width
  • Fixes table formatting to have headers
  • Removes empty paragraphs and links
  • Normalizes bullet points in lists
  • Fixes double <b> tags and replaces them with <strong> tags

Moreover

  • Converts HTML to markdown with table support
  • Converts HTML to text with readable tables!

Custom tags extraction

Extracts tags based on the headline. Useful if you want to filter out noise. List of tags:

  • hipaa
  • iso
  • pci-dss
  • hitrust
  • soc
  • fips
  • nne
  • irap
  • fedramp
  • disa-stig
  • pki
  • gxp
  • govcloud
  • aws-pop-up
  • aws-well-architected
  • oracle-db
  • quick-start
  • partner-network
  • aws-competency
  • courses
  • aws-marketplace
  • solution-consulting
  • regional-expansion
  • tagging
  • language-expansion
  • bottlerocket
  • free-rtos
  • sap
  • launch-wizard
  • deep-racer

Check out src/custom-tags if you want to add more tags or adjust the existing ones.

See Also

Publish

$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags

License

MIT

FAQs

Package last updated on 25 Sep 2023

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc