@beyond-js/code

0.0.1 • Public • Published

@beyond-js/code

Simple utility functions for code manipulation.

Installation

npm install @beyond-js/code

Usage

const { header, scoped } = require('@beyond-js/code');

// Create a header for a file
const fileHeader = header('My JavaScript File');
console.log(fileHeader);

// Wrap code in a scoped IIFE
const myCode = `
const x = 1;
console.log(x);
`;
const scopedCode = scoped(myCode);
console.log(scopedCode);

API

  • header(text: string): string - Creates a comment header for code files.
  • scoped(code: string): string - Wraps code in a scoped IIFE and adds indentation.

License

MIT © [BeyondJS]

/@beyond-js/code/

    Package Sidebar

    Install

    npm i @beyond-js/code

    Weekly Downloads

    6

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    4.15 kB

    Total Files

    10

    Last publish

    Collaborators

    • jircdeveloper
    • ftovar8
    • hello-beyond