Socket
Socket
Sign inDemoInstall

articles-adapter-pluxml

Package Overview
Dependencies
22
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    articles-adapter-pluxml

Adapter to get informations from a pluXml cms


Version published
Weekly downloads
6
increased by500%
Maintainers
1
Install size
8.53 MB
Created
Weekly downloads
 

Readme

Source

articles-adapter-pluxml

Adapter to get informations from a pluXml cms

Install

npm install articles-adapter-pluxml

Usage

Instantiation with a local directory

const PluXmlAdapter = require("articles-adapter-pluxml"),
adapter = new PluXmlAdapter("/var/www/pluxml");

Getting all articles ids as an array of string

adapter.articles.getIds().then((ids)=>{
    console.log(ids);
});

Getting article by id

adapter.articles.getById("0001").then((article)=>{
    console.log(article);
});

Url rewriting

Url rewriting setting use sprintf syntax with the following arguments :

sprintf(rewriteRule, id, slug)

With an article having the following properties :

{id:"0001",slug:"article-slug"}

The following code rewrite url to http://example.com/1-article-slug.html

const adapter = new PluXmlAdapter({
    storage:"/var/www/pluxml",
    rewriteRule:"http://example.com/%d-%s.html"
});
adapter.articles.getById("0001").then((article)=>{
    console.log(article.url); // => http://example.com/1-article-slug.html
});

FAQs

Last updated on 08 Mar 2018

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