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 🙏

© 2025 – Pkg Stats / Ryan Hefner

larfoss-node

v1.0.4

Published

基于Aliyun OSS的nodejs文件管理连接器

Readme

larfoss NodeJS Connector

这是一个基于 Aliyun OSS用于 vue-laravel-file-manager 的nodejs连接器

larfoss

本连接器的Windows和Linux版本:https://github.com/refinec/larf-node

安装

npm install larfoss-node --save

用法

此包应作为中间件实现 express.js服务器

const express = require("express");
const app = express();
const larfOss = require("larfoss-node");

const ossOptions = {
    accesskey: '', //通过阿里云控制台创建的AccessKey
    accessSecret: '', //通过阿里云控制台创建的AccessSecret
    bucket: '', //通过控制台或PutBucket创建的bucket
    region: '', //bucket所在的区域, 默认oss-cn-hangzhou。
    internal: false, //是否使用阿里云内网访问,默认false。比如通过ECS访问OSS,则设置为true,采用internal的endpoint可节约费用。
    cname: false, //是否支持上传自定义域名,默认false。如果cname为true,endpoint传入自定义域名时,自定义域名需要先同bucket进行绑定。
    secure: false, //(secure: true)则使用HTTPS,(secure: false)则使用HTTP
    endpoint: '', //OSS外网域名
    internalEndpoint:'' //OSS内网域名,可省略则默认为OSS外网域名
}

app.use('/', larfOss(ossOptions));
app.listen( process.env.PORT || 3000);

修改使用

**注意:**由于Aliyun OSS的限制,你需要修改 vue-laravel-file-manager 的部分代码以更好地使用。

  1. Thumbnail.vuePreview.vue 文件的loadImage方法中注释源代码,添加以下代码:

    loadImage() {
        GET.thumbnailLink(this.selectedDisk,this.selectedItem.path).then(response =>{
            this.imgSrc = response.data;
        })
    }
  2. AudioPlayer.vueVideoPlayer.vue文件的mounted生命钩子中注释源代码,添加以下代码:

    mounted() {
        this.player = new Plyr(this.$refs.fmVideo);
        HTTP.get(this.$store.getters["fm/settings/baseUrl"] + "stream-file", {
          params: {
            disk: this.selectedDisk,
            path: this.videoFile.path,
          },
        }).then((response) => {
          this.player.source = {
            type: "video",
            title: this.videoFile.filename,
            sources: [
              {
                src: response.data,
                type: `audio/${this.videoFile.extension}`,
              },
            ],
          };
        });
    }
  3. contextMenuActions.js文件的downloadAction方法的 if语句块中注释源代码,添加以下代码:

    HTTP.downloadFile(this.selectedDisk, this.selectedItems[0].path).then((response) => {
        if (typeof response.data === 'string' && /\.txt$/g.test(this.selectedItems[0].path)) {
            tempLink.href = window.URL.createObjectURL(new Blob([response.data]));
        } else {
            tempLink.href = response.data;
        }
        document.body.appendChild(tempLink);
        tempLink.click();
        document.body.removeChild(tempLink);
    });
  4. get.js文件中添加一个get请求方法:

    downloadFile(disk, path) {
        return HTTP.get('download-file', {
            params: {
                disk,
                path
            },
        });
    },