npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fnet/to-rust

v0.1.10

Published

## Introduction

Downloads

178

Readme

@fnet/to-rust

Introduction

The @fnet/to-rust project is designed to facilitate the process of building Rust applications using Flownet. It provides a framework to compile and package a Rust application efficiently, focusing on streamlining the building process while organizing necessary files and directories.

How It Works

This project operates by preparing and structuring a given Rust application source and its dependencies into a designated directory structure. It copies essential files and directories, utilizes specified templates, and builds the Rust application using Cargo. The entire process is automated to require minimal user intervention once parameters are set.

Key Features

  • Directory Management: Automatically organizes necessary files and directories for Rust builds.
  • Template Rendering: Utilizes template directories for consistent output structure.
  • Automated Building: Executes cargo build commands to compile the application for both development and release modes.
  • Configurable Parameters: Allows customization of project details such as name, version, author, and more through parameters.

Conclusion

The @fnet/to-rust project provides users with a straightforward method to compile and package Rust applications with an emphasis on organization and automation. It is a useful tool for developers looking to streamline their Rust application build process while maintaining a structured directory setup.

@fnet/to-rust Developer Guide

Overview

The @fnet/to-rust library facilitates the setup and management of a Rust-based application framework. It focuses on preparing project directories, managing source and destination files, and building your Rust applications. By using @fnet/to-rust, developers can streamline their build process, ensure consistent project structure, and automate the building of Rust applications with ease.

Installation

To install the @fnet/to-rust library, use either of the following commands with npm or yarn:

npm install @fnet/to-rust

or

yarn add @fnet/to-rust

Usage

To use this library, you will typically call the main exported function within your JavaScript or TypeScript files. Below is a basic utilization pattern, where you define configuration parameters to prepare your Rust project build environment and handle generated assets.

Here is how you can make use of the @fnet/to-rust:

import toRust from '@fnet/to-rust';

const config = {
  params: {
    name: "myRustApp",
    entry: "src/esm",
    version: "1.0.0",
    title: "My Rust Application",
    author: "Your Name",
    description: "A simple Rust application built with Flownet",
    vendor: "Your Organization",
    package_dir: "./build/package",
    out_dir: "./build/output"
  },
  src: "/path/to/source",
  dest: "/path/to/destination"
};

toRust(config).then(() => {
  console.log('Rust application build setup complete.');
}).catch((error) => {
  console.error('Failed to prepare Rust application:', error);
});

Examples

Below is a concise example demonstrating the core functionality of @fnet/to-rust:

Basic Setup

import toRust from '@fnet/to-rust';

const config = {
  params: {
    name: "rustProject",
    entry: "src/rust_code",
    package_dir: "./build/package",
    out_dir: "./compiled/output"
  },
  src: "./source",
  dest: "./destination"
};

(async () => {
  try {
    await toRust({
      params: config.params,
      src: config.src,
      dest: config.dest
    });
    console.log('Setup successful!');
  } catch (error) {
    console.error('Error setting up project:', error);
  }
})();

In this example, the toRust function initializes and prepares the necessary directories and builds the Rust application as specified by the configuration params. Ensure that your source and destination paths exist and are valid.

Acknowledgment

The @fnet/to-rust library builds upon the capabilities of the Rust compiler and the Node.js ecosystem to streamline the Rust development process. Special thanks to all contributors who maintain the library and ensure its seamless integration into diverse development environments.

Input Schema

$type: object
$schema: https://json-schema.org/draft/2020-12/schema
properties:
  params:
    type: object
    properties:
      name:
        type: string
        description: The name of the project
        default: rust
      entry:
        type: string
        description: Entry directory for the app
        default: app/esm
      version:
        type: string
        description: Version of the project
        default: 0.1.0
      title:
        type: string
        description: Title of the project
        default: Rust App
      package_name:
        type: string
        description: Package name of the project
        default: Same as name property
      author:
        type: string
        description: Author of the project
        default: Flownet
      description:
        type: string
        description: Description of the project
        default: Rust App built with Flownet
      vendor:
        type: string
        description: Vendor of the project
        default: flownet.ai
      include_css:
        type: boolean
        description: Whether to include CSS
        default: false
      bundle_name:
        type: string
        description: Bundle name of the project
        default: null
      package_dir:
        type: string
        description: Directory for the package
        default: ./.package/{params.name}
      out_dir:
        type: string
        description: Output directory for the build
        default: ./.out/{params.name}
    required: []
  config:
    type: object
    description: Configuration for the build process
  src:
    type: string
    description: Source directory path
  dest:
    type: string
    description: Destination directory path
required:
  - params
  - src
  - dest