<commit_before><!--
  Copyright 2017 IBM Corp.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<script type="text/x-red" data-template-name="file-buffer">
    <div class="form-row">
        <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
        <input type="text" id="node-input-name" placeholder="Name">
    </div>
</script>

<script type="text/x-red" data-help-name="file-buffer">
    <p>This node is ...
    </p>

    <p><b>Usage</b></p>
    <p>This node should be provided in input : </p>
    <ul>
      <li><code>msg.payload</code> : the ...
       </li>
    </ul>
    <p>On successful conversion this node will output : </p>
    <ul>
      <li><code>msg.payload</code> : a stream buffer </li>
    </ul>

</script>

<style type="text/css">
  .node_label_white {
    fill: white;
  }
  #palette_node_file-buffer > div.palette_label {
    color: white;
  }
</style>

<script type="text/javascript">
    (function() {
        RED.nodes.registerType('file-buffer', {
            category: 'function',
            defaults: {
                name: {value: ""}
            },
            credentials: {
              token: {type:"text"}
            },
            color: "rgb(50,150,50)",
            inputs: 1,
            outputs: 1,
            paletteLabel: "file path to buffer",
            icon: "bridge.png",
            label: function() {
                return this.name || "file buffer";
            },
            labelStyle: function() {
                return this.name ? "node_label_italic node_label_white" : "node_label_white";
            }
        });
    })();
</script><commit_msg>Fleshed out the info panel<commit_after><!--
  Copyright 2017 IBM Corp.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<script type="text/x-red" data-template-name="file-buffer">
  <div class="form-row">
    <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
    <input type="text" id="node-input-name" placeholder="Name">
  </div>
</script>

<script type="text/x-red" data-help-name="file-buffer">
  <p>This node is designed to be used in conjuction with the http multipart in node.
  As the multipart node does not provide a buffer, this node can be used to load a
  file using a path into a buffer.
  </p>

  <p><b>Usage</b></p>
  <p>This node should be provided in input : </p>
  <ul>
    <li><code>msg.payload</code> : the path of the file.
    If you are using the http in multipart node then the path for the first file
    will be
      <code>
        var files = Object.keys(msg.req.files);
      </code>
      <code>
        msg.payload = msg.req.files[files[0]][0].path;
      </code>
    </li>
  </ul>
  <p>On successful conversion this node will output : </p>
  <ul>
    <li><code>msg.payload</code> : a buffer containing the file contents</li>
  </ul>

</script>

<style type="text/css">
  .node_label_white {
    fill: white;
  }

  #palette_node_file-buffer>div.palette_label {
    color: white;
  }
</style>

<script type="text/javascript">
  (function() {
    RED.nodes.registerType('file-buffer', {
      category: 'function',
      defaults: {
        name: {
          value: ""
        }
      },
      credentials: {
        token: {
          type: "text"
        }
      },
      color: "rgb(50,150,50)",
      inputs: 1,
      outputs: 1,
      paletteLabel: "file path to buffer",
      icon: "bridge.png",
      label: function() {
        return this.name || "file buffer";
      },
      labelStyle: function() {
        return this.name ? "node_label_italic node_label_white" : "node_label_white";
      }
    });
  })();
</script>
{'fraction_non_alphanumeric': 0.1346823324630113, 'fraction_numerical': 0.007832898172323759, 'mean_word_length': 2.458991723100075, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '565138', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1403, 'n_words': 442}