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

fileable-components

v0.0.5

Published

![fileable logo](./static/docs/logo.png) ![fileable logo](./static/docs/logo.png)

Downloads

7

Readme

fileable logo fileable logo

Fileable Components

Components for use with Fileable.

List of Fileable components

  • File - create files
  • Folder - create folders and archives
  • Clear - remove files and folders

Creating a Fileable Component

Creating fileable components is easy provided that components meet the following criteria.

  1. Must be an asynchronous iterator yielding objects conforming to the "Fileable Component Protocol" (see below)

  2. Must have key 'FILEABLE COMPONENT' equal to true.

Note: this repository exports a convenience method, createComponent, to make this easier.

import {createComponent} from 'fileable-components';
const prototypeCompoent = async function *(){
    //...
}
export default createComponent(prototypeCompoent);

Fileable Component Protocol

Fileable components must yield directives. Directives are object which are objects that have a 'directive' key, along with other keys, that and tell the renderer how to render the file tree.

Directive: FILE

The FILE directive has a 'directive' key set to 'FILE'. It's used to create files.

See the above File component for an example.

key: name

Name of file to create.

key: content

Content of file to create.

key: mode

Mode of file to create.

key: append

If set to true, content will be added to a file. Othewise, content will be ovewrwriten.

key: folder_context

Context in which to create file.

Directive: FOLDER

The FOLDER directive has a 'directive' key set to 'FOLDER'. It's used to create folders.

See the above Folder component for an example.

key: name

Name of folder to create.

key: folder_context

Context in which to create folder.

Directive: CLEAR

The CLEAR directive has a 'directive' key set to 'CLEAR'. It's used to delete files and folders.

See the above Clear component for an example.

key: target

String representing files or folders to delete. May be a glob. May use '!' to negate files.

API

Table of contents

Todo

  • remove unnecessary dependencies
  • add proper typescript typeings
  • create template component