Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

atma-io-middleware-condcomments

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atma-io-middleware-condcomments

Conditional comments middleware for Atma.IO and Atma.Toolkit

latest
npmnpm
Version
1.2.9
Version published
Maintainers
1
Created
Source

Conditional comments file middleware for Atma.IO and Atma.Toolkit. Supports JavaScript and HTML comments.

The Plugin provides a custom middleware to exclude/include conditional comments:

How to use
Extend files

There are 2 strategies: to comment and to uncomment. You should use to comment strategy for default block, so that a file is valid even without a condcomment middleware.

  • Uncomment on TRUE expressions

    /*#if (EXPRESSION)
        content body
    */
    
  • Comment on FALSE expressions

    //#if (EXPRESSION)
    content body
    //#endif
    
Expressions

Expressions are usual javascript expressions. The values for variables are taken from a) ENV and b) process argv c) middleware settings.

Embed into the project
  • Atma Toolkit

    $ atma plugin install atma-io-middleware-condcomments --save-dev
    

    This adds atma-io-middleware-condcomments npm dependency and the package.json would look like:

        {
            "devDependencies": {
                "atma-io-middleware-condcomments"
            },
            "atma": {
                "plugins": [
                    "atma-io-middleware-condcomments"
                ],
                "settings": {
    				"atma-io-middleware-condcomments": {
                        "defines": {
                            "DEBUG": true
                        }
                    },
                    "io": {
                        "extensions": {
                            "ts": [
                                "atma-io-middleware-condcomments:read",
                                "atma-loader-ts:read"
                            ]
                        }
                    }
    
                }
            }
        }
    
  • App Bundler

    $ npm i atma-io-middleware-condcomments --save-dev
    

    Extend AppBundler config with IO settings, for example in package.json for typescript extensions.

    {
        /* ... any package json settings */
        "app-bundler": {
            /* ... any app-bundler settings */
            "middlewares": {                
                "ts": [
                    "atma-io-middleware-condcomments:read",
                    "atma-loader-ts:read"
                ]
            }
        },
    }
    
  • Run

    • Atma Toolkit Dev Server

      $ atma server
      
    • App Bundler Just run app bundler commands as usual

The MIT License

FAQs

Package last updated on 09 May 2025

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