Giter VIP home page Giter VIP logo

nsify's Introduction

nsify NPM version

Build Status Coveralls Status

NetSuite-side require() the node.js

You can use require() the node.js freely on yours JavaScripts.

Required

  • node.js 4+

Install Dependency Status devDependency Status

    sudo npm install nsify -g

Command Line

Generate your SuiteScripts:

    nsify ./test/_files/RE-process-restlet.js >> suite-script-process-restlet.js

Usage NS Annotations

var nsify = require('nsify'),
    filePath = './test/_files/custom/schedule-simple.js',
    nsObj = nsify.annotation(filePath);

console.log(nsObj); // see output
{
    "id": "sp-schedule",
    "type": "schedule",
    "alias": "MySchedule",
    "function": "MySchedule.process",
    "libs": [
        "my-lib.js"
    ],
    "params": {
        "param1": {"name": "Param 1", "type": "INTEGER"}
    }
}

Compatibility with nsmockup

var nsify = require('nsify'),
    nsmockup = require('nsmockup');


nsmockup.init(function() {
    let filePath = './test/_files/custom/schedule-simple.js',
        script = nsify.annotation(filePath, 'nsmockup');

    console.log(script); // see output
    
    nsmockup.createSuiteScript(script.type, script, function($ctx) {
        let alias = script.alias;
        if ($ctx[alias]) {
            console.log(':D works!!');
        }
    });
});

nsify's People

Contributors

danieljoppi avatar leandrocristovao avatar

Stargazers

Alec M avatar Victor Didia avatar Nelson avatar Anton W avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar Everton Amorim avatar

nsify's Issues

add Concat options

Create new NS Annotation: @ns.concat its a array options with all libs path, example:

/**
  * @ns.concat: 'my-libs1.js', 'other-lib2.js'
  * @ns.alias: 'opa'
  */

output - after execute nsify

var myLib1  = (functions ...);
var otherLib2  = (functions ...);
var opa  = (functions ...);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.