New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

document-metaprogrammer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

document-metaprogrammer

A small document meta-programming app in node

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Document Metaprogrammer

A small document meta-programming app in node.

Setup

Install:

npm i -g document-metaprogrammer

Run:

document-metaprogrammer

This will listen to .meta.* files below your working directory and continuously process them.

Example

The basic idea is:

  • Define a .meta.* file:

example-0.meta.py

# < @number=[3,4,5]
def multiply_by_number(value):
    return number * value

# >
  • Let the document-metaprogrammer run! This should continuously build the finished file in the background.

  • Expected output is:

example-0.py

def multiply_by_3(value):
    return 3 * value

def multiply_by_4(value):
    return 4 * value

def multiply_by_5(value):
    return 5 * value

Another example:

example-1.meta.js

// < @value=[foo, bar, baz] 
const say_value = () => {
    console.log('value')
}

// >
module.exports = {
// < @value=[foo, bar, baz]
    say_value,
// >
}

example-1.js

const say_foo = () => {
    console.log('foo')
}

const say_bar = () => {
    console.log('bar')
}

const say_baz = () => {
    console.log('baz')
}

module.exports = {
    say_foo,
    say_bar,
    say_baz,
}

More Details

See inside the examples folder for more details of whats possible!

FAQs

Package last updated on 19 Mar 2019

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