Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fable-core

Package Overview
Dependencies
Maintainers
1
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fable-core

Fable core lib & bindings for native JS objects, browser and node APIs

  • 0.7.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

fable-core

Fable core lib and bindings for native JS objects, browser and node APIs

npm Join the chat at https://gitter.im/fable-compiler/Fable

RELEASE NOTES · Follow us on Twitter!

Installation

npm install --save fable-core

Usage

For general information on how to use Fable, check the docs.

The default file when you import fable-core uses universal modules (UMD) which can be understood by node (commonjs) or require.js (amd). There's also a minified version fable-core.min.js, and if you need the library in other module formats you can import fable-core/es2015 or fable-core/commonjs instead.

F# project (.fsproj)

  <ItemGroup>
    <Reference Include="node_modules/fable-core/Fable.Core.dll" />
  </ItemGroup>

F# script (.fsx)

#r "node_modules/fable-core/Fable.Core.dll"

open Fable.Core
open Fable.Import

require.js

When targeting the browser and using AMD instead of a module bundler, you can load Fable's core lib with require.js as follows:

<script src="node_modules/requirejs/require.js"></script>
<script>
requirejs.config({
    // Set the baseUrl to the path of the compiled JS code
    baseUrl: 'out',
    paths: {
        // Explicit path to core lib (relative to baseUrl, omit .js)
        'fable-core': '../node_modules/fable-core/fable-core.min'
    }
});
// Load the entry file of the app (use array, omit .js)
requirejs(["app"]);
</script>

Development

The source is written in TypeScript. The use of a TypeScript-aware editor (like VSCode or ALM) is highly recommended.

Output files are generated as shown below:

  • fable-core.ts (source)
    • es2015.js (Created from fable-core.ts |> tsc --target ES2015)
      • fable-core.js (Created from es2015.js |> babel --plugins ...umd)
        • fable-core.min.js (Created from fable-core.js |> uglifyjs)
      • commonjs.js (Created from es2015.js |> babel --plugins ...commonjs)

To build

From Fable root project folder, simply run:

build FableCore

Keywords

FAQs

Package last updated on 27 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc