Giter Site home page Giter Site logo

mazipan / preact-script2 Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 757 KB

Preact component for insert <script> tag, inspired by vue-script2

Home Page: https://mazipan.github.io/preact-script2/

License: MIT License

JavaScript 76.08% CSS 0.84% HTML 23.09%
preact-components preact-script2 preact-library

preact-script2's Introduction

preact-script2

Preact component for insert <script> tag, inspired by vue-script2

version minified downloads Travis

Download

# NPM
npm install preact-script2

# Yarn
yarn add preact-script2

Usage

import Script2 from 'preact-script2';

export default class App extends Component {
  render() {
    return (
      <div>
        <Script2 src="/test.js" async type="some-type" integrity="1234567890" text="QWERTYUIOP" crossorigin="anonymous" />
        <Script2
          inlineScript="(function a() {console.warn('Hey, you just loading an inline script')})()" />
      </div>
    );
  }
}

Available Props

Props Name Type Note
src String -
async String -
type String -
integrity String -
text String -
crossorigin String -
inlineScript String -

Development

# NPM

# Running development
npm run dev
# Build demo apps
npm run build
# Build library for publish
npm run bundle

# Yarn

# Running development
yarn dev
# Build demo apps
yarn build
# Build library for publish
yarn bundle

Credit


Copyright © 2019 by Irfan Maulana

preact-script2's People

Contributors

mazipan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.