How to use the fire-fs.readFileSync function in fire-fs

To help you get started, we’ve selected a few fire-fs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tidys / CocosCreatorPlugins / packages / mp3-compress / panel / item / image-item.js View on Github external
init() {
        console.log("image-item 注册组件!");
        Vue.component('image-item', {
            props: ['data', 'index'],
            template: fs.readFileSync(Editor.url('packages://' + packageName + '/panel/item/image-item.html', 'utf8')) + "",
            created() {

            },
            methods: {
                onBtnClickCompress() {
                    // this.data.isUse=!this.data.isUse;
                    // console.log("on use: " + this.data.isUse);
                    // console.log("压缩");
                    // console.log(this.data);
                    window.plugin.onImageItemCompress(this.data);
                }
            },
            computed: {},
        });
    }
};
github tidys / CocosCreatorPlugins / packages / hot-update-tools / mail / Mail.js View on Github external
service: this._service,
            auth: {
                user: this._user,
                pass: this._pass, //授权码,通过QQ获取
            }
        });

        let sendPeople = ['xu_yanfeng@126.com'];
        if (this.isArray(people)) {
            for (let k in people) {
                sendPeople.push(people[k]);
            }
        } else if (typeof people === "string") {
            sendPeople.push(people);
        }
        let data = Fs.readFileSync(Editor.url('packages://hot-update-tools/mail/MailTemp.html', 'utf8')).toString();
        if (data.indexOf('%version%') !== -1) {
            data = data.replace("%version%", version);
        }
        if (data.indexOf('%content%') !== -1) {
            data = data.replace("%content%", content);
        }
        let mailOptions = {
            from: this._user, // 发送者
            to: sendPeople.toString(), // 接受者,可以同时发送多个,以逗号隔开
            subject: '测试版本 发布通知-v' + version, // 标题
            text: 'Hello world', // 文本
            html: data,
        };
        transporter.sendMail(mailOptions, function (err, info) {
            if (sendCb) {
                sendCb();
github tidys / CocosCreatorPlugins / packages / plugin-4399-web-js-sdk / panel / index.js View on Github external
var FS = require("fire-fs");
var PATH = require('fire-path');
var CfgUtil = Editor.require("packages://plugin-4399-web-js-sdk/core/CfgUtil");

Editor.Panel.extend({
    style: FS.readFileSync(Editor.url('packages://plugin-4399-web-js-sdk/panel/index.css', 'utf8')) + "",
    template: FS.readFileSync(Editor.url('packages://plugin-4399-web-js-sdk/panel/index.html', 'utf8')) + "",

    $: {
        logTextArea: '#logTextArea',
    },

    ready() {
        let logCtrl = this.$logTextArea;
        let logListScrollToBottom = function () {
            setTimeout(function () {
                logCtrl.scrollTop = logCtrl.scrollHeight;
            }, 10);
        };
        // Editor.Ipc.sendToMain('plugin-4399-web-js-sdk:clicked');
        window.plugin = new window.Vue({
            el: this.shadowRoot,
github tidys / CocosCreatorPlugins / packages / hot-update-tools / core / CfgUtil.js View on Github external
updateBuildTimeByMain(time) {
        // 在main.js中调用electron中没有remote属性
        // Editor.log(electron.app.getPath('userData'));
        let cfgPath = this._getAppCfgPath();
        if (fs.existsSync(cfgPath)) {
            let data = fs.readFileSync(cfgPath, 'utf-8');
            let json = JSON.parse(data);
            json.buildTime = time;
            json.genTime = time;
            fs.writeFileSync(cfgPath, JSON.stringify(json));
        } else {
            Editor.log("热更新配置文件不存在: " + cfgPath);
        }
    },
    updateBuildTime(time) {
github tidys / CocosCreatorPlugins / packages / excel-killer / panel / item / excelItem.js View on Github external
init() {
        console.log("excel-item 注册组件!");
        Vue.component('excel-item', {
            props: ['data', 'index'],
            template: fs.readFileSync(Editor.url('packages://' + packageName + '/panel/item/excelItem.html', 'utf8')) + "",
            created() {

            },
            methods: {
                onBtnClickUse() {
                    this.data.isUse=!this.data.isUse;
                    console.log("on use: " + this.data.isUse);

                }
            },
            computed: {},
        });
    }
};
github tidys / CocosCreatorPlugins / packages / foobar / inspector.js View on Github external
"use strict";
let packageName = "foobar";
let fs = require("fire-fs");
let path = require('fire-path');


Vue.component('foobar-inspector', {
    style: fs.readFileSync(Editor.url('packages://' + packageName + '/inspector.css'), 'utf8') + "",
    template: fs.readFileSync(Editor.url('packages://' + packageName + '/inspector.html'), 'utf8') + "",

    props: {
        target: {
            twoWay: true,
            type: Object,
        }
    },
    methods: {
        onBtnClickTest() {
            Editor.log('test');
        }
    }
});
github matchvs / OneTwoStep / packages / plugin-matchvs / panel / index.js View on Github external
function step7() {
                        let srcProjectCfg = PATH.join(buildFullDir,
                            "jsb-" + buildData.template + "/frameworks/runtime-src/Classes/matchvsnative/macproj/" + buildData.template + "/project.pbxproj");
                        if (!FS.existsSync(srcProjectCfg)) {
                            window.plugin._addLog("没有发现文件: " + srcProjectCfg);
                            doFailed();
                            return;
                        }
                        let data = FS.readFileSync(srcProjectCfg, 'utf-8');
                        let dstProjectCfg = projectConfigFilePathMac;
                        FS.writeFileSync(dstProjectCfg, data);
                        doSuccess();
                    }
github cocos-creator / engine / extensions / dragonbones / editor / dragonbones-atlas-meta.js View on Github external
static validate (assetpath) {
        var json;
        var text = Fs.readFileSync(assetpath, 'utf8');
        try {
            json = JSON.parse(text);
        }
        catch (e) {
            return false;
        }

        return typeof json.imagePath === 'string' && Array.isArray(json.SubTexture);
    }
github cocos-creator / engine / extensions / dragonbones / editor / dragonbones-meta.js View on Github external
static validate (assetpath) {
        var json;
        var text = Fs.readFileSync(assetpath, 'utf8');
        try {
            json = JSON.parse(text);
        }
        catch (e) {
            return false;
        }

        return Array.isArray(json.armature);
    }
github matchvs / OneTwoStep / packages / plugin-matchvs / panel / index.js View on Github external
_refreshStatus() {
                    let projectPath = Editor.projectInfo.path;
                    let buildCfg = PATH.join(projectPath, "local/builder.json");
                    let buildFolder = PATH.join(projectPath, "build");
                    let data
                    let buildData
                    let buildFullDir
                    if (!FS.existsSync(buildFolder)) {
                        this._setNotBuildStatus();
                    } else {
                        data = FS.readFileSync(buildCfg, 'utf-8');
                        buildData = JSON.parse(data);
                        buildFullDir = PATH.join(projectPath, buildData.buildPath);
                        let srcJsbinding = PATH.join(buildFullDir,
                            "jsb-" + buildData.template + "/frameworks/runtime-src/Classes/matchvsnative/jsb_matchvs_manual.cpp");
                        if (!FS.existsSync(srcJsbinding)) {
                            this._setNotIntegrateStatus();
                        } else {
                            this._setIntegrateStatus();
                        }
                    }
                },
                _setNotBuildStatus() {

fire-fs

node's fs module with some helpful additions.

MIT
Latest version published 8 years ago

Package Health Score

36 / 100
Full package analysis

Popular fire-fs functions