Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inlinify

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inlinify

Inline functions in JavaScript

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

inlinify

Preprocesses JavaScript functions so that they can be inlined as macros.

Example

var inline = require("inlinify")

//Preprocess a function for inlining
var inline_block = inline(
  function(local_arg0, local_arg1) {
    var s = local_arg0 + local_arg1
    this.potato = s
    console.log("s = ", s)
    return s * 10
  }, "inline_prefix_", ["arg0", "arg1"])
  
  
//Retrieve variables
console.log(inline_block.variables)
console.log(inline_block.this_variables)
console.log(inline_block.return_variable)
console.log(body)

require("inlinify")(func, prefix, args)

Preprocesses func so that it can be inlined into a block of code.

  • func is the function to inline
  • prefix is a string which is used to relabel all the variables in func to avoid conflicts
  • args is the list of arguments for func

Returns An object with the following properties:

  • variables a list of the local variables in func
  • this_variables a list of variables in the this object of the func
  • body an inlinable string representing the body of the function
  • return_variable the name of the return variable for the function

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 02 Jun 2013

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc