Coder Social home page Coder Social logo

bundle's Introduction

@putout/bundle NPM version

🐊Putout bundle to get things working in Deno and Browsers using amazing esm.sh.

Usage

import {putout} from 'https://esm.sh/@putout/bundle@2';
import removeDebugger from 'https://esm.sh/@putout/plugin-remove-debugger?alias=putout:@putout/bundle';
import declare from 'https://esm.sh/@putout/plugin-declare-undefined-variables?alias=putout:@putout/bundle';

console.log(putout('isFn(fn, "hello"); debugger', {
    plugins: [
        ['remove-debugger', removeDebugger],
        ['declare-undefined-variables', declare],
    ],
}));

// returns
({
    code: `const isFn = a => typeof a === 'function';\nisFn(fn, "hello");`,
    places: [],
});

When you need to use @putout/plugin-putout use:

import {putout} from 'https://esm.sh/@putout/bundle';
import pluginPutout from 'https://esm.sh/@putout/plugin-putout?alias=putout@putout/bundle';

console.log(putout('compare(a, b)', {
    plugins: [
        ['putout', pluginPutout],
    ],
}));

// returns
({
    code: `const {operator} = require('putout');\nconst {compare} = operator;\ncompare(a, b)`,
    places: [],
});

IIFE

When you want to access putout from global scope using script tag, use:

<script src="https://cdn.jsdelivr.net/npm/@putout/bundle@2/bundle/putout-iife.js"></script>

License

MIT

bundle's People

Contributors

coderaiser avatar enzonotario avatar

Stargazers

 avatar Elena Romashka avatar Josh avatar  avatar Giorgio Bellisario avatar

Watchers

 avatar

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.