Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@magento/directive-parser

Package Overview
Dependencies
1
Maintainers
7
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @magento/directive-parser

Parses Magento PWA Studio directives


Version published
Maintainers
7
Created

Readme

Source

PWA Studio Directive Parser

CircleCI

A Directive in Magento PWA Studio is an inline comment within a source file that signals additional metadata that should be processed by the PWA Studio tooling.

If you're a user of Magento PWA Studio, it's unlikely you're looking to depend on this package directly. The primary use-case for this library is to be consumed by other PWA Studio tools.

Goals

The primary goals of this project are:

  • Parse all JavaScript comments within a source file, and return descriptors for every comment that conforms to the Magento Directive syntax
  • Run significantly faster than a parser that parses the entire ECMAScript grammar
  • Provide actionable warnings/errors with location info

Install

npm install @magento/directive-parser

Usage

const parseDirectives = require('@magento/directive-parser');
const { directives, errors } = parseDirectives(someSourceFileString);

Example Directive (Kitchen Sink)

/**
 * @RootComponent
 * pageTypes = some_page, some_other_page
 * description = "Some description here"
 */

Keywords

FAQs

Last updated on 04 Dec 2019

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