1.3.3 • Published 10 months ago

@mutates/core v1.3.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

@mutates/core

šŸ”§ @mutates/core is the essential package of the Mutates toolset, providing the core functionality to manipulate the Abstract Syntax Tree (AST) of TypeScript files. It serves as the backbone for other specialized packages within the Mutates ecosystem.

npm.io

Features

  • AST Manipulation: Modify the AST of any TypeScript file with ease.
  • TypeScript Focused: Specifically designed for TypeScript, ensuring optimal integration and performance.
  • Extensible: Can be extended with framework-specific packages for additional functionality.

Installation

To install the core package, use the following command:

npm install @mutates/core

Usage

Basic Example

Here is a simple example demonstrating how to use @mutates/core to modify a TypeScript file:

import { addFunctions, creataProject, createSourceFile, saveProject } from '@mutates/core';

// Initialize a new project
createProject();

// Add a TypeScript file to the project
createSourceFile(
  'example.ts',
  `
  const greet = (name: string) => {
    return 'Hello, ' + name;
  };
`,
);

// Perform some transformations
addFunctions('example.ts', {
  name: 'farewell',
  isExported: true,
  statements: "return 'buy!'",
});

// Save the modified file
saveProject();

API Reference

For a comprehensive guide on the available APIs and their usage, please refer to the official documentation

Contributing

šŸ¤ Contributions are welcome! If you have any improvements or suggestions, feel free to open an issue or submit a pull request.

License

šŸ“„ @mutates/core is licensed under the Apache-2.0 License. See the LICENSE file for more information.


For further assistance or to report issues, please visit our GitHub repository.

1.3.3

10 months ago

1.3.2

10 months ago

1.2.3

10 months ago

1.3.1

10 months ago

1.2.2

10 months ago

1.3.0

10 months ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.5

1 year ago