Socket
Socket
Sign inDemoInstall

article-json-to-apple-news

Package Overview
Dependencies
4
Maintainers
5
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    article-json-to-apple-news

Render article JSON in the Apple News format


Version published
Weekly downloads
18
increased by350%
Maintainers
5
Install size
4.23 MB
Created
Weekly downloads
 

Readme

Source

article-json-to-apple-news

Render article json in Apple News format

Build Status

Usage

npm install article-json-to-apple-news
const convertToAppleNews = require('article-json-to-apple-news');
const article = {
  title: 'Article Title',
  author: {
    name: 'John',
    href: 'http://example.com/john'
  },
  publishedDate: new Date('2016-02-04T14:00:00Z'),
  body: [
    {
      type: 'paragraph',
      children: [
        {
          type: 'text',
          content: 'This is the text and '
        },
        {
          type: 'text',
          bold: true,
          content: 'some bold text '
        },
        {
          type: 'text',
          href: 'http://example.com',
          content: 'some link'
        }
      ]
    },
    {
      type: 'embed',
      embedType: 'image',
      src: 'http://example/image.jpg',
      width: 300,
      height: 150
    }
  ]
};

console.log(convertToAppleNews(article, { identifier: 'article-identifier' }));
// {
//   article: <apple news article>,
//   bundlesToUrls: <object that maps bundle:// urls to http(s) urls>
// }

Body format

https://github.com/micnews/html-to-article-json#format

License

MIT

FAQs

Last updated on 23 Mar 2017

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