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

shinfileinputer

v1.0.2

Published

select and access a local file without upload file or files to remote

Downloads

3

Readme

🚀 IT IS A JS MODULE USED IN WEB BROWER

select or access a local file without uploading file or files to remote. with this api,you can access one or some local files ,and get formate of base64/arraybuffer/text of files you have selected

HOW TO INSTALL

yarn add shinfileinputer

OR

yarn add git+https://github.com/shinku/shinfileinputer.git

HOW TO USE

import shinfileinputer,{OUTOUTTYPE} from "shinfileinputer";
const inputer = new shinfileinputer();
inputer.start("*",[OUTOUTTYPE.BASE64]).then(res=>{
    console.log({res});
    //you will get a array of base64, 
}

FUNCTIONS

construncor(ismultiple:Boolean=false){
    //
}
//const inputer = new shinfileinput();

params | type | ps|
-|-|- ismultiple | boolean | choose multiple files or just single file.default is false |

start(accepts:string,outputoption:Array<string>):Promise<T>

params | type | ps|
-|-|- accepts | string | accepts of a input,such as "\*" or "\*.jppg|*.png"| outputoption | Array | default is ["base64"] or [OUTOUTTYPE.BASE64]|

setMultiple(val:Boolean):shinfileinput

you wann to change single file choosen to multiple


inputer.setMultiple(true).start("*“).then(......)

OUTOUTTYPE has three types.

  • BASE64
  • TEXT
  • BUFFER means you will get different kinds of format of these files;
import shinfileinput,{OUTOUTTYPE} from "shinfileinputer";
const inputer = new shinfileinputer();
inputer.start("*",[OUTOUTTYPE.BASE64]).then(res=>{
    console.log({res});
    //[{file:File,datas:[{data:xxxxxxx,type:"base64"}]}]
    //get base64content and also you will get the file
}
....
inputer.start("*",[OUTOUTTYPE.BASE64,OUTOUTTYPE.BUFFER]).then(res=>{
    console.log({res});
    //  //[{file:File,datas:[{data:xxxxxxx,type:"base64"},{data:xxxxxxx,type:"arraybuffer"}]}]
    //get base64content and also you will get the file
}

EXAMPLE: choose a image from local and put it into a Image Element

import shinfileinput,{OUTOUTTYPE} from "shinfileinputer";
const inputer = new shinfileinput();
inputer.start("image/gif, image/jpeg",[OUTOUTTYPE.BASE64]).then(res=>{
    //console.log({res});
    let {datas} = res[0];
    const image = new Image();
    image.src = datas[0]['data'];
    document.body.appendChild(image);
}